Forum Discussion
Chan_Tze_Leong
May 11, 2021Brass Contributor
Link part of file name to Excel cell
I would like to link part of the filename to part of a cell. The name of the Excel file is Excel Mar Sample. The string in an Excel cell is "MTD Mar CY2021". I would like to like the Mar in the filen...
HansVogelaar
May 11, 2021MVP
Create a defined name FileName that refers to =GET.DOCUMENT(88)
You can then use
="MTD "&MID(FileName,FIND(" ",FileName)+1,FIND(" ",FileName,FIND(" ",FileName)+1)-FIND(" ",FileName)-1)&" CY2021"
See the attached version (now a macro-enabled workbook).
- Chan_Tze_LeongMay 17, 2021Brass ContributorDear Hans, When I save the filename say to Apr, the output still shows Mar.
- HansVogelaarMay 17, 2021MVP
Unfortunately, that formula isn't updated automatically, you have to do that manually.
Here is another version. It uses a helper cell.
This time it is an ordinary workbook (not macro-enabled).
- Chan_Tze_LeongMay 17, 2021Brass Contributor
HansVogelaar Even though I saved as Apr, the link could not be updated.