![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 2
|
I have a problem: I have to have the filename of the workbook with path to a cell. There is a function called info to have path but how can you do the filename?
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Probably an easier way but try the following:
=INFO("directory") & GetName & ".xls" Where GetName is a defined name that is referenced as: =GET.WORKBOOK(16)
__________________
Kind regards, Al Chara |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Posts: 2
|
Probably an easier way but try the following:
=INFO("directory") & GetName & ".xls" Where GetName is a defined name that is referenced as: =GET.WORKBOOK(16) I have a Finnish version of Excel and functions are translated to Finnish. Any resources to get functions Finnish/english translations? kko |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Brampton
Posts: 324
|
What about:
=cell("filename") |
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
=cell("filename") will provide the full filename, including the complete path. |
|
|
|
|
|
|
#6 | ||
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
Quote:
=cell("filename",a1) will include the sheetname of the sheet the formula is entered in also (can't help much with Finnish translation though, sorry!)
__________________
:: Pharma Z - Family drugstore :: |
||
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Hi Chris:
I have not figured out what additional benefit is there in including the second argument ... by the way with or without the second argument viz =cell("filename") and =cell("filename",a1) both give the same result including the sheet name I know in most cases of using the cell() function with different info types, use of the second argument 'reference' is either desirable or necessary. However in case of info type 'filename', it does not seem to make any difference. I used to make good use of the similar function cellpointer in working with Lotus 123. Regards! [ This Message was edited by: Yogi Anand on 2002-05-12 21:22 ] |
|
|
|
|
|
#8 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Millbank, London, UK
Posts: 1,790
|
Quote:
Pop your =cell("filename") in 3 of your sheets and take a good look at what each brings back as the sheetname, you'll see they are all the same.... sheet3 on all of them, or sheet1 on all of them, depending on which sheet holds the last-used cell. Goto sheet 1 and enter something in any cell. the fileref will read "sheet1"... take a look at sheet 2 - it will also say "sheet 1" cos of the last active cell. This could cause havoc if you're using this as part of a relative referencing formula (trust me, I wasted many an hour at work before I realised this !!) Anchoring it with A1 specifies the actual sheet the formula is placed on and does not defer to whatever the last-used cell is. (Personally, I anchor it with AA99 as I often delete cell A1 throughout the dynamic design process) _________________ Hope this helps, Chris (Excel '97, Windows ME) marker A1 anchor [ This Message was edited by: Chris Davison on 2002-05-13 05:35 ] |
|
|
|
|
|
|
#9 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
Regards! |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|