+ Reply to Thread
Results 1 to 6 of 6

VBA to count cells that a value (text or numeric)

  1. #1
    Forum Contributor
    Join Date
    07-01-2010
    Location
    Niles, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    137

    VBA to count cells that a value (text or numeric)

    Could someone help me with a VBA code. What I'd like to do is this. If Cell(s) C1, H2, K2, S2, A6, B6, C6, F6, G6, H6, K6, L6, M6, N6, O6 and Q6 have any value in them at all (text or numeric) I want to count them. And cell BB3 would display the number of cells that have a value. My end result is I'm trying to create a progress status of the users input with a conditional formatting. (Hopefully) I've seen this on a site somewhere. So if they have 8 of those cells with something in them this progress bar will show at 50%.

    Open for any options on how to do this though.

    Thanks in advance
    Excel 2010

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: VBA to count cells that a value (text or numeric)

    Don't really have to use VBA, you could just put the CountA formula directly into BB3, but regardless:

    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Forum Contributor
    Join Date
    07-01-2010
    Location
    Niles, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: VBA to count cells that a value (text or numeric)

    That works for me. Thank you very much!

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641

    Re: VBA to count cells that a value (text or numeric)

    Hi there,

    Take a look at the attached workbook and see if it does what you need.

    It uses the following code to ensure that changes to the "target" cells are automatically added to / deleted from the current total of completed cells.

    Please Login or Register  to view this content.
    The highlighted values may be altered to suit your own requirements.


    The worksheet also contains a Progress Indicator Bar which updates in response to changes in the "target" cells.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: VBA to count cells that a value (text or numeric)

    Hi Zimmerman,

    Try the attached file which puts a Progress Bar on the StatusBar.

    In the ThisWorkbook Code module:
    Please Login or Register  to view this content.
    In an ordinary code module such as Module:
    Please Login or Register  to view this content.
    Lewis
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    07-01-2010
    Location
    Niles, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: VBA to count cells that a value (text or numeric)

    Thank you very much to all that has helped. I really like the progress bar on the status bar. So I will probably be going with that one. It's absolutely perfect for what I am doing. Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Count cells with a certain numeric range value
    By C Holmes in forum Excel General
    Replies: 7
    Last Post: 07-17-2014, 02:00 PM
  2. Replies: 3
    Last Post: 05-13-2014, 10:48 PM
  3. [SOLVED] Count how many red colour font text or numeric in a column
    By PRADEEPB270 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-12-2013, 02:56 AM
  4. Count needed - numeric values excluding the text value NA
    By Linda Borza in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-18-2013, 07:17 PM
  5. Replies: 12
    Last Post: 09-17-2012, 01:03 PM
  6. countif function to count text numeric data in same cell
    By keithn@thenails in forum Excel General
    Replies: 4
    Last Post: 11-11-2006, 04:54 PM
  7. count and arrange cells have numeric values
    By amrezzat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-21-2005, 05:58 PM

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