I was looking for a code that will help me look for multiple/dupes in a worksheet when entering information from a userform.
I struggled with this and searched google high and low and used the code:
A bad copy and paste job, perhaps. Instead of telling me only that entry already exists in the sheet, it is telling anything and everything I enter already exists in the sheet, which is wrong.
I fear the issue is either the IsError or the Match telling it to showing everything as a duplicate. Please help in amended/improving this code!
I struggled with this and searched google high and low and used the code:
VBA Code:
If IsError (Application.Match (Me.NameTextBox, Worksheets("Admin").Columns(3),0)) Then
MsgBox "Entry already exists.", vbCritical
Exit Sub
End If
A bad copy and paste job, perhaps. Instead of telling me only that entry already exists in the sheet, it is telling anything and everything I enter already exists in the sheet, which is wrong.
I fear the issue is either the IsError or the Match telling it to showing everything as a duplicate. Please help in amended/improving this code!