Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default check font colour

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default check font colour

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!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default check font colour

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.

--
Regards,
Tom Ogilvy


"Gareth" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
different colour font in same cel ILMER57 Excel Worksheet Functions 4 April 12th 10 04:57 PM
textBox font colour the same as cell font colour???????? Sophie Excel Discussion (Misc queries) 4 February 13th 09 10:15 AM
header font colour Michelle Excel Discussion (Misc queries) 0 June 4th 08 04:35 PM
Font colour phil2006 Excel Discussion (Misc queries) 1 July 31st 06 02:15 PM
can the fill colour of a bar be tied to the data font colour data PaulC Charts and Charting in Excel 0 June 23rd 06 01:21 AM


All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"