View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Getting total number of used rows

hi
more that one way to do this.
1.
Dim s As Long
s = ActiveSheet.UsedRange.Rows
MsgBox s
2.
Dim r As Long
r = Cells(Rows.Count, "a").End(xlUp).Row
MsgBox r

others may post more.
Regards
FSt1
"Pawan" wrote:

Hi

Is there any wya to find out how many rows are boing used in a sheet? I want
to write a macro which needs to operate only on the rows which have some data.

Is there similar way to get number of columns.

Thank You

Regards,
Pawan