Hello all,
I have a textbox named txtCorrectby
I would like that the data that is filled in this textbox matches a list.
If not the user should be warned.
I got this code for it;
But it gives Compile error: Argument not optional
Somebody knows why?
I have a textbox named txtCorrectby
I would like that the data that is filled in this textbox matches a list.
If not the user should be warned.
I got this code for it;
VBA Code:
Private Sub txtCorrectBy_AfterUpdate()
Dim rngCell As Range
Dim bMatch As Boolean
Dim vVal
vVal = txtCorrectBy.Text
bMatch = WorksheetFunction.CountIf(Range(Sheets("PersonSearch")("B2:B153"), vVal)) > 0
'If a match was found then alert the user
If bMatch Then MsgBox ("Name already exsists.")
End Sub
But it gives Compile error: Argument not optional
Somebody knows why?