slattbr
asked on
Loop until Cell is empty
I am having trouble with a simple do/loop. I want to loop until there is no value in the cell in column C. Here is what I currently have:
Counter = 2
Do
Range("D" & Counter).Select
Range("D" & Counter) = Range("Change!C9")
Counter = Counter + 1
Loop While ("C" & Counter) <> Null
This results in the first cell 'D2' being filled in but no other cells in row D.
I have tried Loop Until- this results in a never ending loop. I have also tried
Loop While ("C" & Counter) <> ""- this results in a never ending loop.
Can anyone tell me what I am doing wrong.
Counter = 2
Do
Range("D" & Counter).Select
Range("D" & Counter) = Range("Change!C9")
Counter = Counter + 1
Loop While ("C" & Counter) <> Null
This results in the first cell 'D2' being filled in but no other cells in row D.
I have tried Loop Until- this results in a never ending loop. I have also tried
Loop While ("C" & Counter) <> ""- this results in a never ending loop.
Can anyone tell me what I am doing wrong.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you are welcome....Mike
ASKER
Do While Range("C" & Counter) <> ""
Range("D" & Counter).Select
Range("D" & Counter) = Range("Change!C9")
Counter = Counter + 1
Loop
and worked perfectly.
thanks mike