N Nick Hodge Feb 11, 2006 #3 You will need to do some parsing to get the filename out, but this will give you the whole reference of the path, filename and sheet =CELL("Filename") This give you just the filename =MID(CELL("Filename"),FIND("[",CELL("Filename"),1)+1,(FIND(".",CELL("Filename"),1)+4)-(FIND("[",CELL("Filename"),1)+1)) (Beware the wrap above) -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England www.nickhodge.co.uk (e-mail address removed)
You will need to do some parsing to get the filename out, but this will give you the whole reference of the path, filename and sheet =CELL("Filename") This give you just the filename =MID(CELL("Filename"),FIND("[",CELL("Filename"),1)+1,(FIND(".",CELL("Filename"),1)+4)-(FIND("[",CELL("Filename"),1)+1)) (Beware the wrap above) -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England www.nickhodge.co.uk (e-mail address removed)
D Dave Peterson Feb 11, 2006 #4 No matter which of the suggested formulas you use, you'll be better off to include a cell reference in those formulas: =cell("filename",a1) If you fail to include a cell reference, then when excel recalculates, the formula will evaluate using whatever worksheet/workbook is active. (You can see this by using two workbooks, arranging the windows (window|arrange) and putting: =cell("filename") in each window. Then look at the opposite window.
No matter which of the suggested formulas you use, you'll be better off to include a cell reference in those formulas: =cell("filename",a1) If you fail to include a cell reference, then when excel recalculates, the formula will evaluate using whatever worksheet/workbook is active. (You can see this by using two workbooks, arranging the windows (window|arrange) and putting: =cell("filename") in each window. Then look at the opposite window.
G Guest Feb 12, 2006 #5 Thanks! It Works! JKaz SVC said: To get the full file name including file path, type =cell("filename") Click to expand...
Thanks! It Works! JKaz SVC said: To get the full file name including file path, type =cell("filename") Click to expand...