Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Loop
I have a macro which loops and performs the functions. However it goes
around and does not stop. How do I tell it Do until there is no data in cell or it reaches the end of data in the column. Thanks Cristina |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Loop
Let's say we are processing data in oclumn C and we want to stop at either
the first empty cell in column C or the last value in column C Sub Crissy() Dim C As Range, r As Range Set C = Range("C:C") LastRow = Cells(Rows.Count, "C").End(xlUp).Row For i = 1 To LastRow If IsEmpty(Cells(i, "C").Value) Then Exit Sub MsgBox Cells(i, "C").Value Next End Sub So we both determine the last row and also look for the first empty as well. -- Gary''s Student - gsnu201001 "Christina" wrote: I have a macro which loops and performs the functions. However it goes around and does not stop. How do I tell it Do until there is no data in cell or it reaches the end of data in the column. Thanks Cristina |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
if loop | Excel Discussion (Misc queries) | |||
Do Loop Vs For Each | Excel Discussion (Misc queries) | |||
DO LOOP in VBA | Excel Discussion (Misc queries) | |||
getting out of a if loop | Excel Discussion (Misc queries) |