Hello, and Thank You in Advance.
I have an excel user form with numerous labels (from the form tools). When you click on the label, it initiates the code below and cycles through three colors. I have used this in the past and a friend of my had simplified the coding to pull from one location ("call..." I believe), however, I can't for the life of me remember how to write this to refer each label click to the same seven-ish lines of code to save me from repeating this code 100 times. I want the click to only affect the label that was clicked, not change them all with one click.
Again, thank you.
Tim.
[Private Sub Label4_Click()
If Label4.BackColor = &H8000000F Then
Label4.BackColor = vbYellow
ElseIf Label4.BackColor = vbYellow Then
Label4.BackColor = vbRed
ElseIf Label4.BackColor = vbRed Then
Label4.BackColor = &H8000000F
End If
End Sub]
I have an excel user form with numerous labels (from the form tools). When you click on the label, it initiates the code below and cycles through three colors. I have used this in the past and a friend of my had simplified the coding to pull from one location ("call..." I believe), however, I can't for the life of me remember how to write this to refer each label click to the same seven-ish lines of code to save me from repeating this code 100 times. I want the click to only affect the label that was clicked, not change them all with one click.
Again, thank you.
Tim.
[Private Sub Label4_Click()
If Label4.BackColor = &H8000000F Then
Label4.BackColor = vbYellow
ElseIf Label4.BackColor = vbYellow Then
Label4.BackColor = vbRed
ElseIf Label4.BackColor = vbRed Then
Label4.BackColor = &H8000000F
End If
End Sub]