Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default how do i substitute filename in a formula

I need to write the file name in lets say A1 & then
refer a1 at various place to read data from that file

like a1 = c:\test\a.xls & then

in b1 i will = &a1&sheetname!a1

i am unable to do the same pls help
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default how do i substitute filename in a formula

You would normally use the INDIRECT function to do things like this.
However, INDIRECT does not work with closed files, so your file would
have to be open at the same time. If you can arrange for this to
happen, then you can use a formula like this:

=INDIRECT("'["&A1&"]"&A2&"'!A1")

with A1 containing filename.xls (no need for the path if the file is
open), and A2 contains sheet name.

Hope this helps.

Pete

On Jul 2, 11:46*pm, Rupesh wrote:
I need to write the file name in lets say A1 & then
refer a1 at various place to read data from that file

like a1 = c:\test\a.xls & then

in b1 i will = &a1&sheetname!a1

i am unable to do the same pls help


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default how do i substitute filename in a formula

What if i can not have the files open.
I just want to add list of files & then retive information from the files
names added in the sheet

Thanks



"Pete_UK" wrote:

You would normally use the INDIRECT function to do things like this.
However, INDIRECT does not work with closed files, so your file would
have to be open at the same time. If you can arrange for this to
happen, then you can use a formula like this:

=INDIRECT("'["&A1&"]"&A2&"'!A1")

with A1 containing filename.xls (no need for the path if the file is
open), and A2 contains sheet name.

Hope this helps.

Pete

On Jul 2, 11:46 pm, Rupesh wrote:
I need to write the file name in lets say A1 & then
refer a1 at various place to read data from that file

like a1 = c:\test\a.xls & then

in b1 i will = &a1&sheetname!a1

i am unable to do the same pls help



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default how do i substitute filename in a formula

There is a free download available he

http://www.download.com/Morefunc/300...-10423159.html

Morefunc gives you many new functions, one of which is INDIRECT.EXT
which is designed to work on closed files. I haven't tried it so I
can't comment on it, but it might be worth a go for you.

Hope this helps.

Pete

On Jul 3, 12:52*am, Rupesh wrote:
What if i *can not have the files open.
I just want to add list of files & then retive information from the files
names *added in the sheet

Thanks



"Pete_UK" wrote:
You would normally use the INDIRECT function to do things like this.
However, INDIRECT does not work with closed files, so your file would
have to be open at the same time. If you can arrange for this to
happen, then you can use a formula like this:


=INDIRECT("'["&A1&"]"&A2&"'!A1")


with A1 containing filename.xls (no need for the path if the file is
open), and A2 contains sheet name.


Hope this helps.


Pete


On Jul 2, 11:46 pm, Rupesh wrote:
I need to write the file name in lets say A1 & then
refer a1 at various place to read data from that file


like a1 = c:\test\a.xls & then


in b1 i will = &a1&sheetname!a1


i am unable to do the same pls help- Hide quoted text -


- Show quoted text -


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
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE.... max. limit 8 :( [email protected] Excel Discussion (Misc queries) 6 May 22nd 08 05:33 PM
Is there a way to short this substitute formula? Brad Excel Discussion (Misc queries) 3 May 20th 08 09:39 PM
how do I repeatedly substitute a value in a formula rob_t Excel Worksheet Functions 4 December 18th 07 03:46 AM
substitute the filename in a cell reference with a string in another cell. flummi Excel Discussion (Misc queries) 11 February 22nd 06 01:14 PM
Substitute Formula AmyD Excel Worksheet Functions 2 January 5th 06 01:36 PM


All times are GMT +1. The time now is 11:25 AM.

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"