Sub Show_Shape_Colors()
Dim shapename As String
Dim txt1 As String, txt2 As String
shapename = "Rectangle 2" ' Change to suit
txt1 = "Back color =" & Worksheets(1).Shapes(shapename).Fill.BackColor.RGB
txt2 = "Fore color =" & Worksheets(1).Shapes(shapename).Fill.ForeColor.RGB
MsgBox txt1 + Chr(13) + txt2
End Sub
Change the shapename = "Rectangle 2" line to suit your shapes name
Go back to Excel, Right click your shape and apply the macro to your shape
Select the shape with a Right Click and change the colors and then click the shape
a Msgbox will show you the foreground and back ground colors.
To apply the colors to a shape
Worksheets(1).Shapes(shapename).Fill.ForeColor.RGB = 15478521
Worksheets(1).Shapes(shapename).Fill.BackColor.RGB = 12345678