Group:  Microsoft Excel ยป microsoft.public.excel.templates
Thread: Use filename as parameter in formula

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Use filename as parameter in formula
Steve B 12.12.2005 20:01:03
This is in conjunction with the "Convert formulas to values..." post in
excel.programming. In a template I have formulas that reference another
workbook. However the name of the workbook changes daily (ddmmyy.xls). Is
there a way, when opening the template, to prompt the user to select the
'parent' file, then have that filename be refected in all formulas --- eg
=[ddmmyy.xls]Sheet1!$A$1

TIA, Steve
Re: Use filename as parameter in formula
"Ed Ferrero" <ed[ at ]edferreroremove.com> 13.12.2005 05:54:46
Hi Steve B,

Rewrite the link formulas as INDIRECT(ADDRESS(.. formulas

i.e. Suppose cell A1 contains the workbook name ddmmyy.xls
then
=INDIRECT(ADDRESS(1,2,1,1,A1))
returns the contents of cell B1 in the first sheet of workbook ddmmyy.xls

More generally, if cell A2 contains the sheet name Sheet2 then
=INDIRECT(ADDRESS(1,2,TRUE,,"["&A1&"]"&A2))
returns the contents of cell B1 in sheet Sheet2

Ed Ferrero
http://www.edferrero.com


[Quoted Text]
> This is in conjunction with the "Convert formulas to values..." post in
> excel.programming. In a template I have formulas that reference another
> workbook. However the name of the workbook changes daily (ddmmyy.xls). Is
> there a way, when opening the template, to prompt the user to select the
> 'parent' file, then have that filename be refected in all formulas --- eg
> =[ddmmyy.xls]Sheet1!$A$1
>
> TIA, Steve


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net