Hi All
I am almost sorted with my VB Project.
I have the following code in an AfterUpdate Event
Code
Private Sub TextBox2_AfterUpdate()
Dim LTMod As Range
Dim LTNo As Variant
Dim STMod As Range
Dim STNo As Variant
Set LTMod = Worksheets("Validate").Range("C1:C15")
LTNo = Application.Match(ComboBox1.Value, LTMod, 0)
If TextBox2.Value > LTMod(LTNo).Offset(0, 2).Value Then
MsgBox "Number cannot be higher than " & LTMod(LTNo).Offset(0, 2).Value, vbOKCancel
TextBox2.SetFocus
Exit Sub
End If
End Sub
Display More
However even if the number chosen is less than the required number, I still get the MsgBox advising the Number can not be higher than.
I know the code
works as if i place the code into another textbox i get the correct answer
Should I place the code somewhere other than AfterUpdate?
Thanks