frank_m
03-06-2011, 07:42 PM
Edited and swapped the loop result descriptions twice
I'm confused and need more rest I guess. Or more coffee :bug:
What is different in these two loops?
this loop reports as I would expect (from Cell A1 to the last row in Col A)
For Each aCell In Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row - 1)
MsgBox aCell.Row
Next
Why is this looping technique reporting the last row number first :doh:
For X = 0 To Range("A" & Rows.Count).End(xlUp).Row - 1
MsgBox X
Next
I'm confused and need more rest I guess. Or more coffee :bug:
What is different in these two loops?
this loop reports as I would expect (from Cell A1 to the last row in Col A)
For Each aCell In Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row - 1)
MsgBox aCell.Row
Next
Why is this looping technique reporting the last row number first :doh:
For X = 0 To Range("A" & Rows.Count).End(xlUp).Row - 1
MsgBox X
Next