Hi,
I trust all is well?
I have a userform that allows the user to enter new vehicle numbers and it is all working fine.
Now i want to an exit event on a txtbox that will look if the number doesn't exist already in a named range?
I don't now where to start even so i can even post a code?
I guess it should be something like this:
Any idees how i can write this code?
I trust all is well?
I have a userform that allows the user to enter new vehicle numbers and it is all working fine.
Now i want to an exit event on a txtbox that will look if the number doesn't exist already in a named range?
I don't now where to start even so i can even post a code?
I guess it should be something like this:
Code:
Private Sub txtNewNumber_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Me.txtNewNumber = "Named Range" Then 'Check if the number is not a duplicate
MsgBox "This vehicle already exist, please enter a new number", vbOKOnly + vbExclamation
Cancel = True
End If
End Sub