I am stuck trying to write a vlookup in vba.
The following statement works
But I want to assign it to a variable as follows - But I can't get it to work.
Can someone please advise on how to alter this
Hope someone can help
The following statement works
Code:
.Cells(3, 4).Formula = "=vlookup(Loadings!J3,'C:\Users\Streng\Documents\Spreadsheets\Job Data Base NEW.xls'!T05JOBS,4,FALSE)"
But I want to assign it to a variable as follows - But I can't get it to work.
Code:
Dim Job1 As String
Job1 = Application.WorksheetFunction.VLookup(JobNo, "C:\Users\Streng\Documents\Spreadsheets\Job Data Base NEW.xls'!T05JOBS", 4, False)
Can someone please advise on how to alter this
Hope someone can help