Help!
The following statement works fine:
lookupval = Application.WorksheetFunction.VLookup(Company, Workbooks(main).Worksheets("Comp").Range("A1:G890"), 1)
However, this equivalent statement produces an error:
lookupval = Application.WorksheetFunction.VLookup(Company, Workbooks(main).Worksheets("Comp").Range(Cells(1,1),Cells(890,7)), 1)
Since the size of the array matrix gets calculated on the fly, I need to refer to columns by number, not by letter - that's why I need the second form to work.
Suggestions?
Thanks.
The following statement works fine:
lookupval = Application.WorksheetFunction.VLookup(Company, Workbooks(main).Worksheets("Comp").Range("A1:G890"), 1)
However, this equivalent statement produces an error:
lookupval = Application.WorksheetFunction.VLookup(Company, Workbooks(main).Worksheets("Comp").Range(Cells(1,1),Cells(890,7)), 1)
Since the size of the array matrix gets calculated on the fly, I need to refer to columns by number, not by letter - that's why I need the second form to work.
Suggestions?
Thanks.