Thread: Looping Macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default Looping Macro

Are the values of interest in rows?

Maybe something like this:
Dim lLastRow As Long
For i = 0 To lLastRow - 1
....
Next i

Or this:
Dim myRow As Long
lastcell = Cells(Rows.Count, "A").End(xlUp).Row
myRow = 1
Do Until myRow = lastcell
For i = 1 To Cells(myRow, 1)
....
Next
lastcell = Cells(Rows.Count, "A").End(xlUp).Row
myRow = myRow + 1
Loop

HTH,
Ryan---