+ Reply to Thread
Results 1 to 4 of 4

Thread: Counting Number of Rows with a Header

  1. #1
    Registered User
    Join Date
    09-17-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    15

    Counting Number of Rows with a Header

    My first row has aheader in for the columns. I need to make a variable that counts the number of rows being used without counting the header. Any suggestions?

  2. #2
    Forum Guru jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2007
    Posts
    2,573

    Re: Counting Number of Rows with a Header

    How are you counting the rows now? Just use that criteria and subtract 1.
    HTH
    Regards, Jeff

    If you like the answer(s) provided, why not add some reputation by clicking the * below
    Please use [ Code ] tags when posting [ /Code ]
    Please view/read the Forum rules --- How to mark a thread as solved

  3. #3
    Registered User
    Join Date
    09-17-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counting Number of Rows with a Header

    This is what I have I called column A "PH".

    PH_Count = Sheets("Input").Range("PH").count - 1

    It isn't subtracting the one though.

  4. #4
    Forum Moderator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    4,379

    Re: Counting Number of Rows with a Header

    Use this
    ph_count = (Sheets("Input").Range("A" & Rows.Count).End(xlUp).Row) - 1
    Cheers,
    Arlette

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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.2.0