Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi all,
suppose I have this cell reference: ='c:\[file.xls]sheet1'!X1 and I have the file name "file.xls" in cell A1 on my active worksheet Is there a way to any of the following: - include the string in A1 in the above cell reference between the square brackets? - take the complete path (c:\[file.xls]) from a cell on my worksheet? or do I have to TYPE the complete path in the above cell reference? Thanks for thinking about it. Hans |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Assuming "file.xls" is in A1, type the following in any cell of active sheet. ="'c:\["&A1&"]sheet1'!X1" and take the result of this cell. With kind regards, NAVEEN "flummi" wrote: Hi all, suppose I have this cell reference: ='c:\[file.xls]sheet1'!X1 and I have the file name "file.xls" in cell A1 on my active worksheet Is there a way to any of the following: - include the string in A1 in the above cell reference between the square brackets? - take the complete path (c:\[file.xls]) from a cell on my worksheet? or do I have to TYPE the complete path in the above cell reference? Thanks for thinking about it. Hans |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Naveen,
thanks for your reply. That's how far I had got. But the next bit is the interesting part. When you say "take the result of this cell" how would you do that? Let me give you an example. Suppose X1 actually is a range X1:X10 How would you incorporate the string you suggested (lets say in B1) into e.g. an =average function? =average(????,X1:X10) Thanks, Hans |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I had not realized that INDIRECT is not needed for the workbook part of
a reference (thanks for the post Naveen). But it certainly is needed for range specifications in functions =AVERAGE(INDIRECT("'c:\["&A1&"]sheet1'!X1:X10") HTH Kostis Vezerides |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks all for the excellent brainwork!
Till next time. :-) Hans |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sorry, it doesn't work. Always delivers a #REF.
A1: Example.xls =INDIRECT("'C:\["&A1&"]Expenses'!$G$12") gives #REF This is what ="'C:\["&A1&"]Expenses'!$G$12" delivers: 'C:\[Example.xls]Expenses'!$G$12 Maybe it's not possible at all? Hans |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hans
To include another cell's value in the reference you need to use the INDIRECT function =INDIRECT("'c:\["&A1&"]sheet1'!X1") To get the full path you use the CELL function. CELL("filename") will return the full path, followed by sheet name. To get just the path: =LEFT(CELL("filename"),FIND("]",CELL("filename"))) HTH Kostis Vezerides |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I convert text string into a cell reference | Excel Discussion (Misc queries) | |||
Maintaining cell reference after sorting | Excel Discussion (Misc queries) | |||
indirect function to reference cell on different sheet | Excel Worksheet Functions | |||
dynamic cell reference within a text string | Excel Worksheet Functions | |||
Cell Reference Math | Excel Worksheet Functions |