If statement to test font color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have seen this question in reverse on the forum. Usually the question is
to change the font color when criteria is met.

I need to test the font color in order to determine value. I can do it in
code with a for..next loop but I was wondering if it could be done in an if
statement?

Example: If(fontcolor (A2) = "Red", then "Next Day", "Standard")

What would be the syntax?

Thanks for the help.
 
Try this:

Sub FontColor()
MsgBox "The Font Color Index is " & ActiveCell.Font.ColorIndex
End Sub

If Cell.Font.ColorIndex = 3 Then xxxx

Peter
 
Peter,

Thanks for the quick response.

I may not have been clear. I was looking for a way to enter that same idea
into a cell. Is that possible?
 

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

Back
Top