View Full Version : VBA-Import text file of yesterday's date which is the file name
Joseppo
03-23-2021, 03:54 AM
I am new in Excel VBA and macros and I am facing some difficulties in coding. I am working in a daily data that are placed in a folder everyday, I need a code to import the file of yesterday's date whenever I run the macro. Any suggestions?
Dim YesterdayName as string
YesterdayName = Format(Date-1, "FormatString") & ".xlsm"
It takes a bit more code if you skip Weekends/Holidays and such
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.