Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DaveAlbany
 
Posts: n/a
Default Excel - How to indirectly access a file whose name is in a cell

In workbook A, I want to have a cell filled with the name of a second .xls
file (which may change) and then access cells in workbook B from the original
workbook A.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
 
Posts: n/a
Default Excel - How to indirectly access a file whose name is in a cell

With the text [MyJunk.xls]Sheet1!$A$1 in A1 of File A, and formula
=INDIRECT(A1) in D2, I can display the content of A1 in the file called
MyJunk.XLS
With the text MyJunk.xls in A2,the text Sheet1!A1 in B2, and the formula
=INDIRECT("["&A2&"]"&B2) in D2 of File A, I can again display a cell from
the second file
best wishes

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"DaveAlbany" wrote in message
...
In workbook A, I want to have a cell filled with the name of a second .xls
file (which may change) and then access cells in workbook B from the
original
workbook A.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DaveAlbany
 
Posts: n/a
Default Excel - How to indirectly access a file whose name is in a cel

Thank you very much...I had actually tried this, but with your advice - I was
able to discover that it didn't work in my workbooks because one of the files
has a '-' in its name and this throws off the reference. When I saved the
file without the '-' in its name, it worked fine.

I'm gonna keep playing, because there must be a way to do it with '-' also.

"Bernard Liengme" wrote:

With the text [MyJunk.xls]Sheet1!$A$1 in A1 of File A, and formula
=INDIRECT(A1) in D2, I can display the content of A1 in the file called
MyJunk.XLS
With the text MyJunk.xls in A2,the text Sheet1!A1 in B2, and the formula
=INDIRECT("["&A2&"]"&B2) in D2 of File A, I can again display a cell from
the second file
best wishes

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"DaveAlbany" wrote in message
...
In workbook A, I want to have a cell filled with the name of a second .xls
file (which may change) and then access cells in workbook B from the
original
workbook A.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
arno
 
Posts: n/a
Default Excel - How to indirectly access a file whose name is in a cel

Hi Dave,

you should make a formula to that workbook as a sample and create an
indirect-formula exactly like it, maybe there are eg. some ' -
characters missing in your formula.

arno

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
arno
 
Posts: n/a
Default Excel - How to indirectly access a file whose name is in a cell

indirectly
right! There's a worksheetfunction INDIRECT that exactly does what you
need, it uses the content of a cell to build a reference. See Excel
help on indirect. I am not sure if it will work with filenames, just
have a try.

arno



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
 
Posts: n/a
Default Excel - How to indirectly access a file whose name is in a cell

With text in A1: My-Junk.xls, text in A2: Sheet1, text in A3: A1
Formula in A4: =INDIRECT(CHAR(39)&"["&A1&"]"&B1&CHAR(39)&"!"&C1)
I can pick up the content of the cell in the other file.
Many thanks to Bob Umlas for showing where I was going wrong.
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"DaveAlbany" wrote in message
...
In workbook A, I want to have a cell filled with the name of a second .xls
file (which may change) and then access cells in workbook B from the
original
workbook A.



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
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
excel cell lookup file on harddrive dj_siek Excel Discussion (Misc queries) 4 February 8th 06 12:09 AM
Weird File Open/Save As Behavior [email protected] Excel Discussion (Misc queries) 0 December 9th 05 02:26 AM
Using Jet to read excel file returns blank for last cell - sometim Ron Excel Discussion (Misc queries) 1 December 9th 04 08:21 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 04:48 AM.

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"