repeat macro until empty space in next column

G

Guest

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top