#1   Report Post  
Posted to microsoft.public.excel.programming
AK AK is offline
external usenet poster
 
Posts: 56
Default USEDRANGE

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
usedRange GC Excel Programming 2 March 31st 05 01:44 PM
usedrange Mike[_94_] Excel Programming 4 February 17th 05 03:59 PM
UsedRange Damien McBain Excel Programming 3 July 4th 04 01:55 PM
UsedRange problem Kobayashi[_26_] Excel Programming 4 January 30th 04 05:17 PM
Usedrange Terry VanDuzee Excel Programming 6 August 10th 03 05:57 PM


All times are GMT +1. The time now is 09:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"