Hi all,
Wondered if anyone can help, I've been going through the forums to see if I can find help but nothings coming up.
I have a userform where I choose an employees name from a combobox, then use a vlookup to pull corresponding data from a spreadsheet such as department, etc.. That works works great thankfully, but if I type in an employees names into the combobox that's not in the spreadsheet I get the attached message.
Here is the code I use for the vlookup:-
var1 = Application.VLookup(EmployeeName.Value, Worksheets("Manning List").Range("Manning_list"), 4, False)
SAPNumber.Value = var1
var2 = Application.VLookup(EmployeeName.Value, Worksheets("Manning List").Range("Manning_list"), 3, False)
Staff_Agency.Value = var2
I've tried to use a if else in the code to do nothing in the eventuality that the code doesn't find the name as it shouldn't exist but I'm getting nowhere.
Lack of knowledge unfortunately, so if anyone can help I'd be V grateful.
Thanks
Glynn
![]()
Bookmarks