check font colour

G

Gareth

I have a sheet with approx 15,000 rows of data.

I need a macro to check columns C:M to see if any of the cells have blue or
red font in them and if column O is empty.

If this is the case I would like a simple message box saying "Please check
row ???"

Thanks in advance.

Gareth
 
M

microsoft.public.excel.programming

You don't need to use vb to do that?

Check out the CELL function in excel help. The function will give you a
value for different types of attributes (color, font etc) related to a
cell.

In combination with some IF statements you should be able to get what
you want.

Mat N

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

Tom Ogilvy

Assume empty means it doesn't have a formula or a constant in it.

Dim rng as Range, rw as Range, cell as Range
On error resume next
set rng = Columns(15).SpecialCells(xlblanks)
ON Error goto 0
if not rng is nothing then
for each rw in rng
for each cell in Range(cells(rw.row,"C"),cells(rw.row,"M"))
if cell.Font.colorindex = 3 or cell.Font.ColorIndex = 5 then
msgbox "Check row " & cell.Row
exit sub
end if
next
Next
End if

This assumes the font color is not being produced by conditional formatting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top