Forum Discussion
bullk777
Nov 26, 2018Copper Contributor
Excel Macros
I am trying to import a text file named 2017_recent.txt using macros into a workbook that already has data in it. The issue that I am facing is that this macros has to work for 2018_recent.txt, 2019_...
erol sinan zorlu
Nov 27, 2018Iron Contributor
you can get the year of a date within macro and unite it with the rest of the text file name to get its complete name for example:
dim TxtFileName as string
TxtFilneName=Year(now()) &"_recent.txt"