JeannetteE
Board Regular
- Joined
- May 19, 2016
- Messages
- 53
Hi,
I have a Range of Data that has a normal Font Color of Black, however there is a Conditional Format in place to Change the Font to Red if that Value is not in a specific list. This all works fine but I want to be able to check if any of the values are in Red Text before a macro runs and if there are to Exit the code. My problem is that the code I have only seems to recognize the Formatted Font and not the Conditional Font. I have only added the 2 TestColor lines to test the Values but they all come back with the same values, TestColorFC = 3 and TestColorF = -4105. Any help as always is greatly appreciated.
I have a Range of Data that has a normal Font Color of Black, however there is a Conditional Format in place to Change the Font to Red if that Value is not in a specific list. This all works fine but I want to be able to check if any of the values are in Red Text before a macro runs and if there are to Exit the code. My problem is that the code I have only seems to recognize the Formatted Font and not the Conditional Font. I have only added the 2 TestColor lines to test the Values but they all come back with the same values, TestColorFC = 3 and TestColorF = -4105. Any help as always is greatly appreciated.
Code:
Sub TestFontColor()
LastRow = Range("tblSMServices[Service]").End(xlDown).Row
For i = 4 To LastRow
TestColorFC = Sheets("Services").Range("C" & i).FormatConditions(1).Font.ColorIndex
TestColorF = Sheets("Services").Range("C" & i).Font.ColorIndex
If Range("C" & i).FormatConditions(1).Font.ColorIndex = 3 Then
MsgBox "Test"
GoTo Finish
End If
Next
Finish:
End Sub