Forum Discussion

Chan_Tze_Leong's avatar
Chan_Tze_Leong
Brass Contributor
May 11, 2021

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 filename to the Cell so that when I name the file in the future Excel Apr Sample, the string in the Excel cell is MTD Apr CY2021.      

8 Replies

  • Chan_Tze_Leong 

    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).

Resources