This article provides a sample on using the colorcode in VBA for Excel. In this example the user inputs a colorcode in cell B1. The fill color in cell A1 is changed to the color defined by the colorcode in cell B1. The program uses a Worksheet_Change event handler. The event handler executes whenever the user changes the value in cell B1:
'executes when the user changes the value in cell B1 Private Sub worksheet_change(ByVal target As Range) 'changes the color in cell A1 Range("A1").Interior.Color = Cells(1, 2) End Sub
Color Code 12:
Color Code 450:
Color Code 4500:
Color code 850000:
You can download the file and code related to this article here.