Cell Function/Font Color

  • Thread starter Thread starter HpyTrvlr69
  • Start date Start date
H

HpyTrvlr69

Is there a CELL Function that you can identify the color of a font with?
I would like part of a macro to make a decision based upon the color of the
font in a particular cell.
 
Use font colorindex in your code.

Sub test_for_color()
With ActiveCell.Font
If .ColorIndex = 3 Then
MsgBox "got it right"
Else
MsgBox "not right"
End If
End With
End Sub

You could set the code up with Select Case for varying colors.


Gord Dibben MS Excel MVP
 

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