Dark0Prince
Active Member
- Joined
- Feb 17, 2016
- Messages
- 433
I have more boxes to come and need to know how I can shorten this to one code include all textboxes instead of a new sub for every text box that is added. below is the 177th time I had to write it
Code:
Private Sub Textbox177_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox177.BackColor = -2147483643 Then
TextBox177.BackColor = vbRed
ElseIf TextBox177.BackColor = vbRed Then
TextBox177.BackColor = vbYellow
ElseIf TextBox177.BackColor = vbYellow Then
TextBox177.BackColor = vbGreen
ElseIf TextBox177.BackColor = vbGreen Then
TextBox177.BackColor = -2147483643
End If
End Sub
Last edited: