+ Reply to Thread
Results 1 to 8 of 8

Used cells count

  1. #1
    Registered User
    Join Date
    04-09-2009
    Location
    ireland
    MS-Off Ver
    Excel 2003
    Posts
    21

    Used cells count

    How would you be able to count all the used cells in a specific column?

    I know the following would count all used cells in a worksheet but what about a specific column?
    Please Login or Register  to view this content.
    Last edited by excel09; 04-09-2009 at 06:20 AM.

  2. #2
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    Re: Used cells count

    Hi

    Intersect the UsedRange agaiunst the column you want to count:

    Please Login or Register  to view this content.
    Richard
    Richard Schollar
    Microsoft MVP - Excel

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Used cells count

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    04-09-2009
    Location
    ireland
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Used cells count

    Thanks.

    It counted all the cells in the column though. I am just trying to count cells that have data in them. Cells are either blank or are marked with an 'x' so i am just trying to count the cells with 'x' in them.

    How would i go about doing that?

  5. #5
    Registered User
    Join Date
    04-09-2009
    Location
    ireland
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Used cells count

    I tried the following but still doesnt work:

    Dim num As Integer

    num = Application.CountIf(Sheets(1).Range("B"), "x")

    MsgBox num

    It throws up an application or object defined error

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Used cells count

    Use Counta
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-09-2009
    Location
    ireland
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Used cells count

    Thanks. It works

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Used cells count

    Your post does not comply with Rule 9 of our Forum RULES. If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit. And please never edit a thread in which someone else has responded.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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