Thread: USEDRANGE
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default USEDRANGE

Hi AK,

Try:

'=============
Public Sub Tester()
Dim iCtr As Long

With ActiveSheet.UsedRange
iCtr = .Row + .Rows.Count - 1
End With

MsgBox iCtr

End Sub
'<<=============


---
Regards,
Norman



"ak" wrote in message
...
I use this in VB to check the no. of row used in the activesheet:-

ActiveSheet.UsedRange.Rows.count

BUT if the first row is blank then the total no. of row will be minus by
one.
How can the total no. of rows(including the first blank row) be counted?