I have a big range of cells on 'Sheet 1' A column that I have conditionally formatted. I want to put the RGB color code (if possible in format RRR, GGG, BBB) next to the A column.
Say for example if the conditionally formatted cell has yellow color in any of the cell in A column I need to get the RGB code next to the A column.
Sub Get_RGB_Color_Of_Cell()
Dim cColor, cRed, cGreen, cBlue
Dim i, j, x As Integer
j = 2
i = 2
x = 1
Do While Range("A" & j) <> ""
ActiveSheet.Cells(i, x).Select
cColor = ActiveSheet.Cells(i, x).Interior.Color
cRed = (cColor Mod 256)
cGreen = (cColor \ 256) Mod 256
cBlue = (cColor \ 65536) Mod 256
MsgBox (cRed & " " & cGreen & " " & cBlue)
j = j + 1
i = i + 1
Loop
End Sub
This is not the complete code I was failed to get the color of the Formatted cell it shows in the message box as 255 255 255 for all differently formatted cells with different color.
Thanks in advance..