View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default count rows in a column for looping

For i = 1 To Cells(Rows.Count, 2).End(xlUp).Row
--
Gary''s Student - gsnu200714


"damorrison" wrote:

I was using this code

RwsCnt = ActiveSheet.UsedRange.Rows.Count
for i = 1 to RwsCnt

'Code

Next i

it works correctly but the value of the row count increases as the
macro goes along

how can I get this to count just the rows in column B?