+ Reply to Thread
Results 1 to 3 of 3

how to count rows

  1. #1
    Registered User
    Join Date
    06-21-2006
    Posts
    16

    how to count rows

    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

  2. #2
    Piotr Lipski
    Guest

    Re: 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. #3
    Bob Phillips
    Guest

    Re: how to count rows

    Activesheet.UsedRange.Rows.Count

    perhaps?


    --
    HTH

    Bob Phillips

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

    "Seeking help" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1