filename in spreadsheet
filename in spreadsheet
(OP)
Is there an easy way to show a spreadsheet's filename and path without typing it in manually?
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
|
RE: filename in spreadsheet
=CELL("filename")
that should do
regards
Mogens
RE: filename in spreadsheet
RE: filename in spreadsheet
Just using CELL("filename") can give funny results when working on multiple workbooks/sheets.
Regards,
Joerd
RE: filename in spreadsheet
I have experienced that, bud didn't know this option.
regards
Mogens
RE: filename in spreadsheet
RE: filename in spreadsheet
So you "only" have to parse the string, find the square brackets, and return the part of the string between the brackets as the filename.
All in one, this gives you something like:
=MID(CELL("filename",A1),SEARCH("[",CELL("filename",A1))+1,SEARCH("]",CELL("filename",A1))-SEARCH("[",CELL("filename",A1))-1)
Have fun.
Regards,
Joerd
RE: filename in spreadsheet
Function Filename(r As Range)
Application.Volatile
Filename = r.Worksheet.Parent.Name
End Function
Call this function from your sheet as =Filename(A1), for example.
Regards,
Joerd
RE: filename in spreadsheet
I had tried other ways but I was being too simplistic