Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlighting
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?? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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?? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
highlighting | Excel Discussion (Misc queries) | |||
highlighting | Excel Discussion (Misc queries) | |||
Highlighting a Row | Excel Worksheet Functions | |||
Highlighting | Excel Discussion (Misc queries) | |||
Highlighting blanks via GO TO SPECIAL is not highlighting blank cells - HELP, I'm totally stuck. | Excel Discussion (Misc queries) |