Hi,
I'm trying to create the below lookup in VBA using a variable as the datasheet to lookup to. I get an error of "Object does not support this Property or Method" any ideas why
![]()
Sub lookuptoanothersheet() Dim wbkmain As Workbook Dim wbkdatasheet As Workbook Set wbkmain = ThisWorkbook Set wbkdatasheet = Workbooks.Open("C:\Users\james\Documents\VBA\example.xlsx") wbkmain.Worksheets(1).Range("b1").Formula = "vlookup(A1,[" & wbkdatasheet & "]Table1!A1:C200,2,0)" End Sub
Bookmarks