Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to count rows


Hi all,

could you provide me with some VBA coding that will count the tota
numbers of rows and return the value or displaying it when it is bein
run..thanks:

--
Seeking hel
-----------------------------------------------------------------------
Seeking help's Profile: http://www.excelforum.com/member.php...fo&userid=3565
View this thread: http://www.excelforum.com/showthread.php?threadid=55547

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default how to count rows

On Mon, 26 Jun 2006 02:16:01 -0500, Seeking help wrote:

Hi all,

could you provide me with some VBA coding that will count the total
numbers of rows and return the value or displaying it when it is being
run..thanks:)


For single worksheet:

Public Function GetRowCount()
GetRowCount = 65536
End Function

As an alternative you can try:

Public Function GetRowCount()
GetRowCount = Range("A65536").End(xlUp).Row
End Function

If you don't want to count header row:

Public Function GetRowCount()
GetRowCount = Range("A65536").End(xlUp).Row - 1
End Function

--
PL
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default how to count rows

Activesheet.UsedRange.Rows.Count

perhaps?


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Seeking help"
wrote in message
...

Hi all,

could you provide me with some VBA coding that will count the total
numbers of rows and return the value or displaying it when it is being
run..thanks:)


--
Seeking help
------------------------------------------------------------------------
Seeking help's Profile:

http://www.excelforum.com/member.php...o&userid=35658
View this thread: http://www.excelforum.com/showthread...hreadid=555475



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
count count multiple rows Lise Excel Discussion (Misc queries) 5 December 18th 08 04:41 AM
Count all rows in column with data, Except rows 1-5 Gregory Day Excel Worksheet Functions 4 March 27th 08 02:58 PM
Count number of rows, where non relevant rows are hidden Pieter Excel Discussion (Misc queries) 2 November 8th 06 12:24 PM
Count rows and insert number to count them. Mex Excel Discussion (Misc queries) 6 August 23rd 06 02:29 AM
Why does rngDataSource.Rows.Count = 65536 when worksheet Rows=95? [email protected] Excel Discussion (Misc queries) 12 July 22nd 05 12:50 PM


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

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

About Us

"It's about Microsoft Excel"