repeat macro until empty space in next column

S

Sabba Efie

Assume two columns. I want to perform an operation on a cell in the first
column and then repeat that operation on the cell below as long as there is
at least one character in the second column. When the second column is blank
the operation stops. I set up a macro to perform the operation and move down
one cell. Now I want to check the second column and repeat the macro until a
blank cell is reached.
 
D

David Billigmeier

Try something like this... replace ActiveCell.Offset(i,0) = "a" with the
operation you are looking to perform:

Sub repeat()
i = 0
Range("A1").Select
While (ActiveCell.Offset(i, 1) <> "")
ActiveCell.Offset(i, 0) = "a"
i = i + 1
Wend
End Sub
 
Top