Results 1 to 23 of 23

Count Cells By Color not working with conditional formatting.

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-29-2019
    Location
    Drenthe, Netherlands
    MS-Off Ver
    Dutch Office 2019
    Posts
    291

    Question Count Cells By Color not working with conditional formatting.

    I like counting the amount of red cell trigger by conditional formatting. I found a nice script on the internet. It works wel when i color a cal myself. But the cells that are colored with conditional formatting don't get count. Is there a fix or a better script for this problem.
    A second software is a no go because of company policy.
    Function CountCellsByColor(rData As Range, cellRefColor As Range) As Long
        Dim indRefColor As Long
        Dim cellCurrent As Range
        Dim cntRes As Long
     
        Application.Volatile
        cntRes = 0
        indRefColor = cellRefColor.Cells(1, 1).Interior.Color
        For Each cellCurrent In rData
            If indRefColor = cellCurrent.Interior.Color Then
                cntRes = cntRes + 1
            End If
        Next cellCurrent
     
        CountCellsByColor = cntRes
    End Function
    Last edited by Frigide; 01-29-2019 at 03:14 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Count conditional formatting color
    By emina002 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2016, 12:37 AM
  2. Conditional Color Scale Formatting Not Working
    By Merf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-24-2015, 10:03 AM
  3. VBA Count Color of Conditional Formatting
    By roy__lam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2014, 01:08 PM
  4. Replies: 3
    Last Post: 05-30-2014, 10:24 AM
  5. Replies: 5
    Last Post: 09-24-2013, 03:42 PM
  6. Replies: 14
    Last Post: 10-19-2011, 08:27 AM
  7. Color Count in conditional formatting in pivot table
    By mangeshp4 in forum Excel General
    Replies: 4
    Last Post: 10-15-2010, 07:52 AM

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