switters_aka
Board Regular
- Joined
- Oct 26, 2010
- Messages
- 118
I'm having this annoying problem and would appreciate some help if anyone has the time. I am running validation code on a userform to check if an entry is valid. I am calling the sub from a beforeupdate event on the textbox. The check works perfectly other than the .set focus which is not setting the focus on the offending textbox. The solution must be obvious but not to a newbie like me.
Code:
If IsNumeric(UserForm2.eupTB5.Value) Then
Exit Sub
Else
MsgBox "This is not a valid number"
With UserForm2.eupTB5
.Value = ""
.SetFocus
End With
End If