Results 1 to 19 of 19

Function Count_Color does not work at any given color

Threaded View

  1. #1
    Registered User
    Join Date
    12-20-2023
    Location
    Tilburg, The Netherlands
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2412 Build 16.0.18324.20240) 64-bit
    Posts
    28

    Function Count_Color does not work at any given color

    Hello,

    I find beneath VBA on the Internet. I installed & tested it.
    But it won't work for any color given.
    Your help is very appreciated

    Function COUNT_COLOR(range As range, color As range)
        Dim COLORC As Integer
        Dim COUNTT As Integer
        COLORC = color.Interior.ColorIndex
        Set IC = range
            For Each IC In range
                If IC.Interior.ColorIndex = COLORC Then
                COUNTT = COUNTT + 1
            End If
            
            Next IC
                
        COUNT_COLOR = COUNTT
            
    End Function
    Last edited by AliGW; 05-29-2024 at 10:08 AM. Reason: Code tags added - please review the forum guidelines.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Pie color macro doesn't work
    By fantom in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2014, 05:32 PM
  2. Color function not work after copy paste from other sheet
    By unley in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-19-2010, 01:14 AM
  3. fill color and font color no longer work!
    By sflass94133 in forum Excel General
    Replies: 15
    Last Post: 08-21-2007, 11:44 AM
  4. [SOLVED] Fill color doesn't work although font color does.
    By Marco in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-07-2006, 07:50 PM
  5. [SOLVED] My fill color and font color do not work in Excel Std Edition 2003
    By chapstick in forum Excel General
    Replies: 1
    Last Post: 09-11-2005, 04:05 PM
  6. [SOLVED] Using boolean function for color fill:get color cell
    By Kanchi in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  7. fill color doesn't work
    By Judy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-12-2005, 09:06 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