K
Kris_Wright_77
I am developing userform that needs to validate any change in a textbox.
If the new data is outside of the specified region, then I want the current
textbox to be remain selected, but unfortunately I cant find a way to do this.
The code I am currently using is
Private Sub BENCH_Tour_Amber_txt_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not BENCH_Tour_Amber_txt.Value <> 100 Then
BENCH_Tour_Amber_txt.Value = Format(Me.BENCH_Tour_Amber_txt.Value, "")
Else
MsgBox Prompt:="Amber Tolerance Must Be Between 0 & 100",
Buttons:=vbExclamation
End If
End Sub
Also
This re-occurs numerous times in the same userform, so is it possible to
write the code no matter which textbox is "exited", or will I just have to
repeat for each textbox??
Thanks for any help that you can give.
If the new data is outside of the specified region, then I want the current
textbox to be remain selected, but unfortunately I cant find a way to do this.
The code I am currently using is
Private Sub BENCH_Tour_Amber_txt_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not BENCH_Tour_Amber_txt.Value <> 100 Then
BENCH_Tour_Amber_txt.Value = Format(Me.BENCH_Tour_Amber_txt.Value, "")
Else
MsgBox Prompt:="Amber Tolerance Must Be Between 0 & 100",
Buttons:=vbExclamation
End If
End Sub
Also
This re-occurs numerous times in the same userform, so is it possible to
write the code no matter which textbox is "exited", or will I just have to
repeat for each textbox??
Thanks for any help that you can give.