[email protected] wrote...
Its seems pretty simple.
1. which functions returns parameters like worksheet name ?
Same way can i get what is file name ?
The only built-in function that returns these is CELL. You could use
CELL("Filename",A1) to get both the workbook filename and the worksheet
name corresponding to the range reference 2nd argument *IF* you've
already saved the file. In that case, it'll return something like
D:\test\[foo.xls]bar
You can parse the worksheet name using
=MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,32)
the base filename using
=MID(CELL("Filename",A1),FIND("[",CELL("Filename",A1))+1,
FIND("]",CELL("Filename",A1))-FIND("[",CELL("Filename",A1))-1)
and the full pathname using
=SUBSTITUTE(LEFT(CELL("Filename",A1),FIND("]",
CELL("Filename",A1))-1),"\[","\",LEN(CELL("Filename",A1))
-LEN(SUBSTITUTE(CELL("Filename",A1),"\[","\")))