ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Vlookup External Reference (https://www.excelbanter.com/excel-programming/292356-vba-vlookup-external-reference.html)

WashoeJeff

VBA Vlookup External Reference
 
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




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

acw[_2_]

VBA Vlookup External Reference
 
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
-----Original Message-----
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




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-

----
http://www.newsfeeds.com - The #1 Newsgroup Service in

the World!
-----== Over 100,000 Newsgroups - 19 Different Servers!

=-----
.



All times are GMT +1. The time now is 12:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com