Find number of rows in worksheet

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Find number of rows in worksheet

  1. #1
    Board Regular
    Join Date
    Sep 2011
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Find number of rows in worksheet

     
    Hello,

    Please could you tell me how to find the number of rows (empty or filled) in a worksheet?

    (I need my macro to work in different excel versions so can't assume the usual ~65000 rows)

    Thanks,

    Poiu

  2. #2
    Board Regular
    Join Date
    Dec 2011
    Posts
    3,638
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Find number of rows in worksheet

    Hi

    Try:

    Code:
    MsgBox Sheets("SheetNameHere").Rows.Count
    For testing your Regular Expression patterns, try my Regular Expression Pattern Testing add-in!

    For notes on how to use it - see here.

  3. #3
    New Member
    Join Date
    Aug 2012
    Location
    Greater Manchester
    Posts
    41
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Find number of rows in worksheet

    Dim LASTROW As String
    LASTROW = Range("A65536").End(xlUp).Row

    That usually works for me when I know that Col A will contain info in the last row.

  4. #4
    Board Regular
    Join Date
    Jul 2006
    Location
    Brussels
    Posts
    7,944
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Find number of rows in worksheet

    Quote Originally Posted by salfordchameleon View Post
    Dim LASTROW As String
    LASTROW = Range("A65536").End(xlUp).Row

    Dim LASTROW As Long

    Regards,

    Wigi

    http://www.wimgielis.com

    Excel MVP 2011-2014

  5. #5
    New Member
    Join Date
    Aug 2012
    Location
    Greater Manchester
    Posts
    41
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Find number of rows in worksheet

      
    cheers wigi

    as you can tell, I'm still learning !!!

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com