I've run into a tad bit of a problem, I'm trying to make a userform textbox flash continuously if there is an error in it. What I keep ending up with is it flashing to green, then red, finally back to green (3 flashes total) and stays green until the error is corrected. I get the why, but I'm trying to make it go for a lot longer than those 3 seconds (or whatever I set the timer to). I've placed the code I've managed to put together so far below. As always, all help is appreciated.
BTW, I have tried using data validation, but that only appears to work if the userform is not used and the userform must be used in this instance.
Private Sub cboTime_AfterUpdate()
If cboTime.Value = txtLTime.Value Then
cboTime.SetFocus
cboTime.BackColor = RGB(0, 255, 0)
Application.Wait Now + TimeValue("00:00:01")
cboTime.BackColor = RGB(255, 0, 0)
Application.Wait Now + TimeValue("00:00:01")
cboTime.BackColor = RGB(0, 255, 0)
Application.Wait Now + TimeValue("00:00:01")
ElseIf cboTime.Value <> txtLTime.Value Then cboTime.BackColor = RGB(255, 255, 255)
End If
End Sub
Bookmarks