Hi, I have a userform where I am searching Sheet2, ColumnA for a value, if it finds the value then it performs a function. Now I need to divide that and find only certain values among those values to perform yet another function. I am stuck on how this needs to work in my last IF statement, if it finds THIS or THIS or THIS Then? How do I create the "OR"? I just get a type mismatch error.
Dim strFind As String, rLookRnge As Range, vLookRnge As Range
strFind = TextBox1
strFindJob = TextBox2
Set rLookRnge = Sheets(1).Columns(1) 'Change to suit
Set vLookRnge = Sheets(2).Columns(1) 'Sheet2 Pick and Send list
If Application.WorksheetFunction.CountIf(rLookRnge, strFind) <> 0 Then
MsgBox strFind & " already exists. Please create a new A Number!", vbCritical
Me.TextBox1.Enabled = True
Me.TextBox1.SetFocus 'Change to suit
Exit Sub
End If
If Application.WorksheetFunction.CountIf(vLookRnge, strFindJob) <> 0 Then
'Check for specific job
If Me.TextBox14.Value = "" And strFindJob = "142-ARDC" Or "80-777") Then
MsgBox "You need to list separate Jobs with Qty's in the 'COMMENTS' box!", vbExclamation, "Message"
Exit Sub
End If
Thanks for any help!
Bookmarks