Results 1 to 3 of 3

Thread: Does it is possible to have color shading in a Count if cell

  1. #1
    Join Date
    Oct 2011
    Posts
    89

    Does it is possible to have color shading in a Count if cell

    Is there a way to count a cell if it has color shading. I have no values in my cells, but they are either shaded a color or not. I only want to count the cells that have color shading in the range I select. Is this possible. I would rather not enter values or text in the cells to count them.

  2. #2
    Join Date
    May 2011
    Posts
    410

    Re: Does it is possible to have color shading in a Count if cell

    Try the following code :
    Code:
    Function CountColor(Color As Range, Range As Range) As Long
    Dim C As Range
    For Each C In Range
    If C.Interior.ColorIndex = Color.Interior.ColorIndex Then
    CountColor = CountColor + 1
    End If
    Next
    End Function
    I do not knwo how much you know about VBA so here goes. I am assumign that you want to use this function on multiple workbooks and not just the one right now. You will need to save this function to your personel macro work book. To do this you need to go to tools, Macro, record new macro, choose personel macro workbook, Hit the little stop button or go to tools macro stop. Go to Window, Unhide, personel macro workbook. As it is unhid click Alt+F11. This will open the VBA window. Insert Module. Highlight the function from this posting and copy into your module. To use the formula type =COUNTCOLOR( Then click on cell color that you want to know the count of, Click the range that you want to count.

  3. #3
    Join Date
    Aug 2011
    Posts
    700

    Re: Does it is possible to have color shading in a Count if cell

    There is no option for this in Microsoft Excel 2007. This application cannot calculate Count IF with color support. And there is no add-in provide for the same also.

Similar Threads

  1. How to change cell color in excel based on text input
    By Chini mao in forum Windows Software
    Replies: 2
    Last Post: 06-01-2012, 08:19 PM
  2. Change Color of a cell of Gridview control in Asp.Net
    By Bellamy in forum Software Development
    Replies: 5
    Last Post: 16-12-2010, 10:22 PM
  3. HP Color LaserJet 5 issue with drum count
    By Poushali in forum Hardware Peripherals
    Replies: 4
    Last Post: 14-08-2010, 11:44 PM
  4. How to put background color for html cell
    By Preetish in forum Software Development
    Replies: 3
    Last Post: 07-08-2009, 03:32 PM
  5. Excel Added macro for cell color
    By Xylon in forum Software Development
    Replies: 3
    Last Post: 19-02-2009, 11:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •