I am trying to create a user form & I am stuck.
I get this error:
Run-time error '5'
invalid procedure call or argument
Here is the code
Thanks for the help!
I get this error:
Run-time error '5'
invalid procedure call or argument
Here is the code
VBA Code:
rivate Sub CommandButton1_Click()
'submit button to add new customer
Dim xxx As Worksheet
Set xxx = Worksheets("cmast")
lastrow = xxx.Range("a" & Rows.Count).End(xlUp).Row
'Cust # and Name Entered
If Me.Custnum = "" Or Me.custname = "" Then
MsgBox ("You must enter a Customer Number and Customer Name")
Exit Sub
End If
' Check Cust # does not exist
If WorksheetFunction.Match(Me.Custnum, xxx.Cells("A:A"), 0) = "" Then ' <<<this line is the issue
MsgBox ("it worked")
End If
End Sub
Thanks for the help!