Sub ColorSceme()
With ActiveCell.Interior
Debug.Print "Interior: "; .Color, ColorCodeToRGB(.Color), .ColorIndex
End With
With ActiveCell.Borders(xlEdgeTop)
Debug.Print "Top: "; .Color, ColorCodeToRGB(.Color), .ColorIndex
End With
With ActiveCell.Borders(xlEdgeBottom)
Debug.Print "Bottom: "; .Color, ColorCodeToRGB(.Color), .ColorIndex
End With
With ActiveCell.Borders(xlEdgeLeft)
Debug.Print "Left: "; .Color, ColorCodeToRGB(.Color), .ColorIndex
End With
With ActiveCell.Borders(xlEdgeRight)
Debug.Print "Right: "; .Color, ColorCodeToRGB(.Color), .ColorIndex
End With
End Sub
Public Function ColorCodeToRGB(lColorCode As Long) As String
' [URL]http://www.buygold.net/v02n04/v02n04.html[/URL] [modified]
' 1996/01/16 Return the individual colors for lColorCode.
' 1996/07/15 Use Tip 171: Determining RGB Color Values, MSDN July 1996.
' Enter with:
' lColorCode contains the color to be converted
'
' Return:
' iRed contains the red component
' iGreen the green component
' iBlue the blue component
'
Dim lColor As Long
lColor = lColorCode 'work long
iRed = lColor Mod &H100 'get red component
lColor = lColor \ &H100 'divide
iGreen = lColor Mod &H100 'get green component
lColor = lColor \ &H100 'divide
iBlue = lColor Mod &H100 'get blue component
ColorCodeToRGB = iRed & ", " & iGreen & ", " & iBlue
End Function