Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Paula Luxenberg" wrote in message ... I don't know how many colors you have and if they need to be dynamic, but here's a simple macro: Sub FindColorCells() Dim ColorRange As String, Cell As Variant, ColorNumber As Long, BlankCells As Integer, NonBlankCells As Integer ColorRange = "A1:A10" 'Your Range ColorNumber = 65535 'Your color (This is yellow) For Each Cell In Range(ColorRange) If Cell.Interior.Color = ColorNumber Then If Cell.Value = vbNullString Then BlankCells = BlankCells + 1 Else NonBlankCells = NonBlankCells + 1 End If End If Next Cell 'The results of your macro MsgBox "There were " & BlankCells & " blank cells and " & NonBlankCells & " non blank cells in your range" End Sub and if you need to handle a cell that 'looks' blank but has a space(s) in it... If Len(Trim(Cell.Value))0 then .... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change background color based on cell content from link | Excel Discussion (Misc queries) | |||
Change cell background color based on content that results from li | Excel Discussion (Misc queries) | |||
Count cells in range w/specific background color? | Excel Worksheet Functions | |||
how to count cells with specific format (background color)? | Excel Discussion (Misc queries) | |||
How do you count cells with background color yellow? | Excel Discussion (Misc queries) |