View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Determining Target font colour

If the cell interior is filled by standard format method, then:

Private Sub Worksheet_Change(ByVal Target As Range)
Set myRange = Sheets(1).Range("A1")
If Target = myRange Then
MsgBox myRange.Interior.ColorIndex
End If
End Sub

This next one is a little tricky. It basically does the same thing
but it only returns the setting for the conditional format and
does not tell you if the condition is met. That means that if
the condition is not met, the cell will not be color coded.

Private Sub Worksheet_Change(ByVal Target As Range)
Set myRange = Sheets(1).Range("A1")
If Target = myRange Then
MsgBox myRange.FormatConditions(1).Interior.ColorIndex
End If
End Sub


"kirkm" wrote:


I'm wanting to detect if the font colour in the selected cell is black
or yellow.
Been playing with target. and the drop down items but can't see
anything (yet).

Any help appreciated.
Thanks - Kirk