Hello,
I'm trying to figure out how to add a vlookup to a longer macro I'm working on but I keep running into a variety of errors. I ended up creating a new Sub () to test out a very simple vlookup macro in the hopes of figuring out what's going on.
I went to this website VLOOKUP In VBA and copied exactly a sample code they provided there (only thing I changed was substituting in my own lookup value and range), but I'm still getting an "object required" error. Is there something wrong with the provided code, or do I have a setting off on my computer? I've tried to use vlookup in a macro several different ways but I keep getting assorted errors (including object required) and it's getting immensely frustrating. Any help would be greatly appreciated!
I'm trying to figure out how to add a vlookup to a longer macro I'm working on but I keep running into a variety of errors. I ended up creating a new Sub () to test out a very simple vlookup macro in the hopes of figuring out what's going on.
I went to this website VLOOKUP In VBA and copied exactly a sample code they provided there (only thing I changed was substituting in my own lookup value and range), but I'm still getting an "object required" error. Is there something wrong with the provided code, or do I have a setting off on my computer? I've tried to use vlookup in a macro several different ways but I keep getting assorted errors (including object required) and it's getting immensely frustrating. Any help would be greatly appreciated!
Code:
Sub Fustrated()
Dim E_name As String
E_name = "Lira"
Sal = Application.WorksheetFunction.VLookup(E_name, Admin.Range("AF3:AG12"), 2, False)
MsgBox "Number" And Sal
End Sub