ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   referring to a cell containing a file name (https://www.excelbanter.com/excel-discussion-misc-queries/121374-referring-cell-containing-file-name.html)

[email protected]

referring to a cell containing a file name
 
Can you tell me if this is possible?

Instead of putting the file name in the original cell, I want to
reference it.
For example, cell B10 contains "ABC.xls"

But in A1 I want to refer to it like this:
=SUM([B10]Sheet5!A5:A10)

Do I need to add quotation marks or anything? It doesn't seem to like
this...

Thanks


Gary''s Student

referring to a cell containing a file name
 
Use INDIRECT() to splice cell contents:


=SUM(INDIRECT("[" & B10 & "]Sheet5!$a$5:$a$10"))

--
Gary's Student


" wrote:

Can you tell me if this is possible?

Instead of putting the file name in the original cell, I want to
reference it.
For example, cell B10 contains "ABC.xls"

But in A1 I want to refer to it like this:
=SUM([B10]Sheet5!A5:A10)

Do I need to add quotation marks or anything? It doesn't seem to like
this...

Thanks



Dave Peterson

referring to a cell containing a file name
 
The function you'd want to use that's built into excel is =indirect(). But that
function returns an error if the sending workbook is closed.

Laurent Longre has an addin (morefunc.xll) at:
http://xcell05.free.fr/

That includes =indirect.ext() that may help you.

wrote:

Can you tell me if this is possible?

Instead of putting the file name in the original cell, I want to
reference it.
For example, cell B10 contains "ABC.xls"

But in A1 I want to refer to it like this:
=SUM([B10]Sheet5!A5:A10)

Do I need to add quotation marks or anything? It doesn't seem to like
this...

Thanks


--

Dave Peterson


All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com