LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
flummi
 
Posts: n/a
Default substitute the filename in a cell reference with a string in another cell.

Thanks Kostis,

for investigating this. Hope I don't take too much of your time.

What I did is this:

I loaded the workbook "example.xls
Then I created a new workbook
In this new workbook I created a simple cell reference to a cell in
example.xls
Then I closed example.xls
That gave me the full path in my reference in the new workbook.
Then I copied the filename "example.xls" from the above reference into
cell A1 in my new workbook
Then I copied the formula into another cell and modified it as you
suggested (indirect(....)
That gave me the #REF whilst the old formula still delivered the
correct result.

Here's a "screenshot"

Example.xls

904 #REF!

='C:\[Example.xls]Expenses'!$G$12 <-- formula that delivers 904
=INDIRECT("'c:\["&A1&"]Expenses'!$G$12") <-- formula that delivers
#REF
'c:\[Example.xls]Expenses'!$G$12 <-- this is what I get when I strip
off the indirect() function from the previous command

Hans

 
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
how do I convert text string into a cell reference Dave Davis Excel Discussion (Misc queries) 4 May 18th 23 11:48 AM
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
indirect function to reference cell on different sheet Dolemite Excel Worksheet Functions 2 August 19th 05 05:25 PM
dynamic cell reference within a text string gvm Excel Worksheet Functions 4 July 25th 05 02:40 AM
Cell Reference Math Ralph Howarth Excel Worksheet Functions 0 January 26th 05 06:27 PM


All times are GMT +1. The time now is 10:02 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"