I have a form with a combo box, ComboBox1, that allows the user to select an existing employee from the range DATATBL ("a2500") on the worksheet HideEmployee. I then want to use that value to look up several other pieces of data from that employee record and display in the form. I have tried several code examples but keep coming up with error 424 Object required. I a looking for the proper way address the range in VLOOKUP function. Thank you for your help.
Code:
Private Sub ComboBox1_change()
Dim cStatus as string, cClass as string, cEmp as string
cEmp=Me!ComboBox1.Value
' cStatus=Application.Vlookup(cEmp, Sheet.hideemployee.range("a2:d500"), 4, False)
cStatus=Excel.Application.WorksheetFunction.Vlookup(cEmp,Sheet.HideEmployee.Range("a2:d500"), 4, False)
if cStatus="A" then
Me!CheckBox1.Value=True
else
Me!CheckBox1.Value=False
end if
End Sub
Last edited by a moderator: