You can access the internal color of the fomatting conditions (and not what currently belongs to the cell), assuming that this is the first condition applied to the cell:
Range("A1").FormatConditions(1).interior.color
Here is a function that will return color codes for all conditional formats that the cell contains. It will not return anything if there are no conditions, and if there is a condition, but color is not set for it, then it tells you "none".
Function ConditionalColor(ByVal cell As Range) Dim colors As String Dim i As Long For i = 1 To Range(cell.Address).FormatConditions.count If Range(cell.Address).FormatConditions(i).Interior.Color <> 0 Then colors = colors & "Condition " & i & ": " & _ Range(cell.Address).FormatConditions(i).Interior.Color & vbLf Else colors = colors & "Condition " & i & ": None" & vbLf End If Next If Len(colors) <> 0 Then colors = Left(colors, Len(colors) - 1) End If ConditionalColor = colors End Function
UPDATE : If you're interested (I was), the color code that Excel uses is actually BGR, not RGB. Therefore, if you want to convert the code to RGB values, you can use this:
Function GetRGB(ByVal cell As range) As String Dim R As String, G As String Dim B As String, hexColor As String hexCode = Hex(cell.Interior.Color) 'Note the order excel uses for hex is BGR. B = Val("&H" & Mid(hexCode, 1, 2)) G = Val("&H" & Mid(hexCode, 3, 2)) R = Val("&H" & Mid(hexCode, 5, 2)) GetRGB = R & ":" & G & ":" & B End Function
source share