lundi 5 mars 2018

VBA to loop through current row cells and stop on next non zero value - leave that as active cell

I have a file with very long rows of data. They are formulae and many of the results are zero values. I would like a macro that will loop through the active row and stop at the next non-zero value cell, leaving that as the active cell.

This will save time scrolling through looking manually for the non-zeros and also avoid the human error of missing them as you scroll through.

I think (in pseudo code) I want something along the lines of:

For active cell To end of row

If value is zero then active cell x+1

Next

End if

End

I can't write VBA myself, just vaguely understand what it is doing by reading it and can copy and modify similar coding but I can't find anything close enough for this. I haven't a clue how to declare the variables etc. at the top either.

I would really really appreciate some help with this. I have been struggling with it for months and I think it should probably be quite simple.

Thank you in advance.

Tanya.

Aucun commentaire:

Enregistrer un commentaire