KentBurel
Board Regular
- Joined
- Mar 27, 2020
- Messages
- 68
- Office Version
- 2019
- Platform
- Windows
I'm building a simple test case to understand how to set the BackColor property of an ActiveX Command button to one of the 56 colorindex colors. I can get it to work with the RGB function. My code looks like this:
How do I do the same thing using ColorIndex numbers?
Or how do I convert ColorIndex numbers to RGB values?
VBA Code:
Sub ControlColor()
Dim myColorindex As Integer
Dim i As Integer
Dim response As String
For i = 1 To 56
Worksheets("Sheet1").Label1.BackColor = RGB(0, 0, 255)
response = MsgBox("Continue?", vbOKOnly, " ")
Next i
End Sub
How do I do the same thing using ColorIndex numbers?
Or how do I convert ColorIndex numbers to RGB values?