Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50061

[SOLVED] VBA Userform combobox diplicate entries

$
0
0
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:

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

Any idees how i can write this code?

Viewing all articles
Browse latest Browse all 50061

Trending Articles