I think RYG traffic light icons would too small to highlight. I went to
https://www.iconsdb.com/red-icons/circle-icon.html
to get 32x32 ico files. There's many other colors and shapes
This is just example of cycling Red-Yellow-Green-Blue for each of 4 steps
Capture.JPG
Option Explicit
Dim iStep As Long
Dim aryColors(1 To 4) As String
Private Sub UserForm_Initialize()
With Me
.Height = 260 ' hides ico's on bottom half
Call SetIcon(1, "R")
Call SetIcon(2, "R")
Call SetIcon(3, "R")
Call SetIcon(4, "R")
End With
iStep = 1
End Sub
Private Sub CommandButton1_Click()
If aryColors(iStep) = "B" Then
iStep = iStep + 1
If iStep = 5 Then
Me.Hide
Unload Me
End If
End If
Call SetIcon(iStep, "")
End Sub
Private Sub SetIcon(i As Long, c As String)
If Len(c) = 0 Then
Select Case aryColors(i)
Case "B"
aryColors(i) = "R"
Case "R"
aryColors(i) = "Y"
Case "Y"
aryColors(i) = "G"
Case "G"
aryColors(i) = "B"
End Select
Else
aryColors(i) = UCase(c)
End If
With Me
Select Case aryColors(i)
Case "R"
Set .Controls("Image" & i).Picture = .Red.Picture
Case "Y"
Set .Controls("Image" & i).Picture = .Yellow.Picture
Case "G"
Set .Controls("Image" & i).Picture = .Green.Picture
Case "B"
Set .Controls("Image" & i).Picture = .Blue.Picture
End Select
End With
End Sub