Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Barb Reinhardt
 
Posts: n/a
Default Dynamic VLOOKUP function

I have a VLOOKUP function that looks something like this:

=VLOOKUP(A1,[Book3]Sheet1!$A$1:$C$3,3,FALSE)

I want to be able to change the value of the workbook that's used for the
lookup function. Let's say the workbook name is stored in B1.

What do I need to do with the equation to get this to work?

Thanks in advance,
Barb Reinhardt


  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

You could use INDIRECT....however, this REQUIRES that the other wb be open.
As soon as the other wb is closed and the active wb calculates the formula
will return a #REF! error.

The formula would be:

=VLOOKUP(A1,INDIRECT("["&B1&"]Sheet1!A1:C3"),3,0)

Where B1 = File_Name.xls

Biff

Reinhardt" wrote in message
...
I have a VLOOKUP function that looks something like this:

=VLOOKUP(A1,[Book3]Sheet1!$A$1:$C$3,3,FALSE)

I want to be able to change the value of the workbook that's used for the
lookup function. Let's say the workbook name is stored in B1.

What do I need to do with the equation to get this to work?

Thanks in advance,
Barb Reinhardt



  #3   Report Post  
Barb Reinhardt
 
Posts: n/a
Default

I'll try that. Are there any other options where the WB can be closed?

"Biff" wrote in message
...
Hi!

You could use INDIRECT....however, this REQUIRES that the other wb be
open. As soon as the other wb is closed and the active wb calculates the
formula will return a #REF! error.

The formula would be:

=VLOOKUP(A1,INDIRECT("["&B1&"]Sheet1!A1:C3"),3,0)

Where B1 = File_Name.xls

Biff

Reinhardt" wrote in message
...
I have a VLOOKUP function that looks something like this:

=VLOOKUP(A1,[Book3]Sheet1!$A$1:$C$3,3,FALSE)

I want to be able to change the value of the workbook that's used for the
lookup function. Let's say the workbook name is stored in B1.

What do I need to do with the equation to get this to work?

Thanks in advance,
Barb Reinhardt





  #4   Report Post  
Biff
 
Posts: n/a
Default

Hi!

There is a VBA routine written by Harlan Grove that is supposed to do this.
I have never tried it but have seen it discussed in the forum. Try doing a
search for Harlan Grove Pull. Pull is the name of the routine.

Biff

"Barb Reinhardt" wrote in message
...
I'll try that. Are there any other options where the WB can be closed?

"Biff" wrote in message
...
Hi!

You could use INDIRECT....however, this REQUIRES that the other wb be
open. As soon as the other wb is closed and the active wb calculates the
formula will return a #REF! error.

The formula would be:

=VLOOKUP(A1,INDIRECT("["&B1&"]Sheet1!A1:C3"),3,0)

Where B1 = File_Name.xls

Biff

Reinhardt" wrote in message
...
I have a VLOOKUP function that looks something like this:

=VLOOKUP(A1,[Book3]Sheet1!$A$1:$C$3,3,FALSE)

I want to be able to change the value of the workbook that's used for
the lookup function. Let's say the workbook name is stored in B1.

What do I need to do with the equation to get this to work?

Thanks in advance,
Barb Reinhardt







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with VLookup function JohnK Excel Worksheet Functions 6 August 22nd 05 12:52 PM
Adding a Macro to a VLookup Function Wanda H. Excel Discussion (Misc queries) 1 August 16th 05 08:37 PM
Vlookup w/Date Function cym Excel Worksheet Functions 1 March 25th 05 08:21 PM
How can I see an example of the vlookup function in excel? Ian G Excel Worksheet Functions 2 November 14th 04 11:34 PM
Regarding IF function or vLOOKUP function wuwu Excel Worksheet Functions 2 November 13th 04 01:38 PM


All times are GMT +1. The time now is 08:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"