Thread: Highlighting
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Filip Mateasko Filip Mateasko is offline
external usenet poster
 
Posts: 7
Default Highlighting

Hi Lisa,
try this:

Sub CountYellow()

Dim counter As Integer
Dim r As Range
counter = 0

Set r = Range("A1", Range("A1").SpecialCells(xlLastCell))
For Each c In r.cells
If c.Interior.ColorIndex = 6 Then counter = counter + 1
Next
MsgBox counter
End Sub


Maybe you will need to change the Colorindex, it depends on which yellow you
use.
You can also modify the MsgBox to show you some additional informations ;-)

Regards
Filip



"Lisa" píse v diskusním príspevku
...
I have a report with multiple columns and rows, this is
reviewed for errors and any that are found are highlighted
yellow. What I am wanting to do is be able to say "count
any cell highlighted in yellow and sum" Does anyone know
if this can be done or am I just dreaming??