This article provides a sample for getting the desired color code. The user selects a fill color for the cell A1. After pressing the Get Code button the color code used will be printed in cell B1.
It can be seen from the figures below that after the user selects a fill color for the cell A1 and presses the Get Code button the color code is printed in cell B1:
Color code 15773696:
Color code 52879:
Color code 65535:
The program uses a Button_Click event handler. Whenever the user presses the Get Code button the event handler is executed:
'executes whenever the user presses the Get Code
Private Sub btnRun_Click()
'gets the color code used to fill cell A1a
Cells(1, 2) = Range("A1").Interior.Color
You can download the file and code related to this article here.
If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Also please visit my website www.software-solutions-online.com