+ Reply to Thread
Results 1 to 4 of 4

Count by Cell Text Color

  1. #1
    Registered User
    Join Date
    08-23-2011
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    57

    Count by Cell Text Color

    I would like to count cells in excel based on the color of the text in the cell. I found the code below. It seems to work well, except in regard to one thing: when I have a cell within the range that is formatted to utilize the specific color being identified, the code will count that cell even if the cell has nothing in it. Is there any way to modify this formula such that the count will only include cells within the range that have data in it (or, more specifically if it matters, a number in it)?

    Thanks!!

    Code:
    ------------------------------------------------------------

    Please Login or Register  to view this content.
    -----------------------------------------------------------

    This is the corresponding code I am using for sum, by the way, which seems to work well:

    Please Login or Register  to view this content.
    Last edited by excel-help; 06-23-2016 at 01:13 PM.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Count by Cell Text Color

    Hello excel-help,

    You seem to maybe have forgotten the Forum Rules.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Count by Cell Text Color

    Post deleted.
    Last edited by Winon; 06-23-2016 at 12:45 PM. Reason: Post duplicated

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Count by Cell Text Color

    Hello excel-help,

    You need to add another IF statement to the code...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. Swapping cell content to INCLUDE CELL FORMATTING (Text color, background color, etc)
    By jcpeterson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-10-2014, 10:09 AM
  2. Macro to change cell text color based on darkness of cell fill color
    By cincyshirm61 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2014, 12:11 PM
  3. Replies: 4
    Last Post: 12-29-2013, 11:41 PM
  4. Replies: 0
    Last Post: 09-26-2012, 01:08 PM
  5. Count by Color and Text in a cell
    By BobTerwilliger in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2006, 05:59 PM
  6. count by specific text color in range of cell
    By Tii99 in forum Excel General
    Replies: 2
    Last Post: 04-04-2006, 04:58 AM
  7. change text color based on adjacent cell text color
    By matthewst in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-01-2005, 03:49 PM

Tags for this Thread

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