+ Reply to Thread
Results 1 to 7 of 7

count occupied cells, but put count total in different worksheet

  1. #1
    Registered User
    Join Date
    06-29-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    41

    Angry count occupied cells, but put count total in different worksheet

    Hello,

    I need a macros to count the # of occupied cells in a worksheet but be able to run it from a different worksheet.

    I would like it to count how many occupied cells there are starting from row 2,column A (and extending to E) in "Sheet1".
    But!
    I would like to be able to assign this macros to a button in cell B5 of a worksheet named "MTBR" , and have the total count populate cell B6 in MTBR.

    Hope someone can help, I know how to assign a button to a macro.

    thanks!

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: count occupied cells, but put count total in different worksheet

    Is there a reason why you can't use a COUNT formula?
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    06-29-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: count occupied cells, but put count total in different worksheet

    Nope i could use a count formula, i'm just not sure how i would do that. I have three lists in my worksheet "sheet1" they occupy columns A,C,E (so B and D are empty). And this list could get bigger so i would need the formula to be prepared for that and change as new entries were added. I tried just a simple "=COUNT(A$2:E$300), but it gave me zero.
    thanks

  4. #4
    Registered User
    Join Date
    07-23-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: count occupied cells, but put count total in different worksheet

    You can just do a normal count. Set the range to be the entire column, like =COUNT(A:A). that way, as the column grows, it will continue to count. The count function does not count blank cells.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: count occupied cells, but put count total in different worksheet

    I don't know what's in those cells, but COUNT will count cells with numbers; use COUNTA otherwise.

  6. #6
    Registered User
    Join Date
    06-29-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: count occupied cells, but put count total in different worksheet

    how do I get it to not count row one, but then all the rest? because my data is columns A:E but the first row is just titles, and my list consists of a letter than a 4 digit number so "COUNT" doesn't work, and "COUNTA" adds in the first row that I don't want added.

    thanks

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: count occupied cells, but put count total in different worksheet

    Subtract 1 from the COUNTA().
    Note that the COUNTA() will count ALL occupied cells, including those with formulas returning "" values. If you have those and you don't want them counted you can do a count with COUNTIF(range,"?*").

+ 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