I have the following Code:
However this only seems to work when the rest of the code has run, and therefore updated the spreadsheet with the data.
I need this piece of code to run, if the textbox looses focus, please could someone tell me what the event is I require.
I have tried TxtCC_Change, but this happens as soon as an entry is made, which obviously is not helpful.
Many Thanks
Code:
Private Sub TxtCC_AfterUpdate()
If Not IsNumeric(TxtCC.Value) Then
MsgBox "Only Numbers Please"
Cancel = True
End If
With TxtCC
If (Len(.Value) <> 4) Then
MsgBox "Only 4 Numbers Allowed"
Cancel = True
End If
End With
End Sub
However this only seems to work when the rest of the code has run, and therefore updated the spreadsheet with the data.
I need this piece of code to run, if the textbox looses focus, please could someone tell me what the event is I require.
I have tried TxtCC_Change, but this happens as soon as an entry is made, which obviously is not helpful.
Many Thanks