VBA Vlookup External Reference

  • Thread starter Thread starter WashoeJeff
  • Start date Start date
W

WashoeJeff

Any help would be appreciated
Lookup_Data = WorksheetFunction.VLookup(Model, RngLookup, 2, False)
I want to use RngLookup for a range eventually in an .xla however I cant
seem to get an external reference to an open file when it is not the active
workbook

In other words is it possible to use that function referencing an open file
that is not the activesheet? if so I need the syntax

Thank you

Jeff
 
Hi

Try something like this.

Set rnglookup = Workbooks("book1").Sheets("sheet1").Range
("a1:b3")

model = 1

lookup_data = WorksheetFunction.VLookup(model, Range
(rnglookup.Address(external:=True)), 2, False)
MsgBox lookup_data


Tony
 
Back
Top