Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Vlookup in book which will change.

Hi,
I'm creating a template to search in a price list in a closed book, this
book will change its name every week, so I want to put the name of the
book in a cell and use this name as an argument in a vlookup function.
Is this feasible?

Ex:
A1 - PriceList0.xls

C10 - =VLOOKUP(B10,'P:\PRICES\[PriceList0.xls]Products'!$A$2:$B$10,2,0)

Now in C10 I'd like to change the formula to use the value in A1.

Any suggestions?

Regards,
--
Beto
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Vlookup in book which will change.

Hi Beto
if your other workbook is OPEN you may try the following
=VLOOKUP(B10,INDIRECT("'[" & A1 & "]Products'!$A$2:$B$10"),2,0)
This won't work if the other workbook is closed.


You may also have a look at the following thread (describing further
alternatives for accessing closed workbooks): http://tinyurl.com/2c62u

--
Regards
Frank Kabel
Frankfurt, Germany

Beto wrote:
Hi,
I'm creating a template to search in a price list in a closed book,
this book will change its name every week, so I want to put the name
of the book in a cell and use this name as an argument in a vlookup
function. Is this feasible?

Ex:
A1 - PriceList0.xls

C10 -
=VLOOKUP(B10,'P:\PRICES\[PriceList0.xls]Products'!$A$2:$B$10,2,0)

Now in C10 I'd like to change the formula to use the value in A1.

Any suggestions?

Regards,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Vlookup in book which will change.

Hi Beto,

I was able to set that up doing the following. There may a neater way but I
believe this will work for you. An expmple to show the process, you will
need to adapt your cells etc.

A1 = [
A2 = "PriceList" (no quotes)
A3 = 10 (or whatever PlricList number)
A4 = ]
A5 = =A1&A2&A3&A4
C1 = The vlookup value
C2 = A5&"Sheet1!$A$1:$B$5" (with quotes)
F2 = =IF(ISNA(VLOOKUP(C1,INDIRECT(C2),2,0)),"",
VLOOKUP(C1,INDIRECT(C2),2,0))

Two workbooks named and saved as PriceList0 and PriceList10 with the lookup
tables in A1:B5. This is to simulate the workbook name changes.

Change A3 to either 10 or 0 and enter the lookup values in C1.
So if the new workbook is always PriceList and some number, all you have to
do is change the number in A3 for the formula to lookup in the new book

HTH
Regards,
Howard
"Beto" wrote in message
...
Hi,
I'm creating a template to search in a price list in a closed book, this
book will change its name every week, so I want to put the name of the
book in a cell and use this name as an argument in a vlookup function.
Is this feasible?

Ex:
A1 - PriceList0.xls

C10 - =VLOOKUP(B10,'P:\PRICES\[PriceList0.xls]Products'!$A$2:$B$10,2,0)

Now in C10 I'd like to change the formula to use the value in A1.

Any suggestions?

Regards,
--
Beto



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Vlookup in book which will change.

Thanks to both for your implementations and suggestions, I haven't tried
them yet, but I'm sure it will point me in the right direction.

Regards,
--
Beto
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
Why does sheet formatting change when pasting into a new book? CSchwass Excel Discussion (Misc queries) 0 January 29th 10 06:40 PM
How do I change a work book number. I always getting workbook 1 Geothemann Excel Discussion (Misc queries) 1 July 16th 09 05:39 PM
No need of save change confirmation at closing book Shariq Excel Discussion (Misc queries) 3 January 10th 07 09:26 PM
Change Work Book Caption tx12345 Excel Discussion (Misc queries) 6 August 15th 06 07:01 PM
Change Path names in copied work book jheaney Excel Worksheet Functions 2 November 18th 04 07:29 PM


All times are GMT +1. The time now is 11:36 PM.

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

About Us

"It's about Microsoft Excel"