View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default 'For - Next' question

If you have to specify the start and end rows as arguments to the Cells
property, then it would seem to me that you might just as well say

For RowNdx = 1 To 150

there is no more dynamic aspect to your code.

Which leads on to, post the rest of the code.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"RJH" wrote in message
...
Why wouldn't this statement bail out after 150 rows?

For RowNdx = Sheets(1).Cells(1, 3).Row To Sheets(1).Cells(150, 3).Row Step

1

I use a 'If RowNdx 150 then exit sub' in my loop to bail out when

needed,
but I'm sure there's a better way.

Thanks for the help.

RJH