Results 1 to 5 of 5

Find number of rows in worksheet

This is a discussion on Find number of rows in worksheet within the Excel Questions forums, part of the Question Forums category; Hello, Please could you tell me how to find the number of rows (empty or filled) in a worksheet? (I ...

  1. #1
    Board Regular
    Join Date
    Sep 2011
    Posts
    370

    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

    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

    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,075

    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


    Excel MVP 2011, 2012, 2013



    For more Excel memes: visit http://www.wimgielis.be ==> English articles ==> Excel memes

    -- Topics without [CODE] tags or a meaningful topic title, will be neglected by me (and probably many others as well) --

  5. #5
    New Member
    Join Date
    Aug 2012
    Location
    Greater Manchester
    Posts
    41

    Default Re: Find number of rows in worksheet

    cheers wigi

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

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