I have a code that opens a file for me, but sometimes someone forgets to throw it into a folder. How to add code to start a file for the current month with creation date. and if there was an old file it would show information. Be careful there is an old file or you want to continue some like that.
This one isn't work for me
This one isn't work for me
Rich (BB code):
Format(Date, "mm")
Rich (BB code):
MyFolder = "C:\Users\V1410190\Documents\Y2021" & Format(Date, "mm")
MyFile = Dir(MyFolder & "\Finance2021refresh*.xlsm")
If MyFile <> "" Then
Set data_wb = Workbooks.Open(MyFolder & "\" & MyFile, UpdateLinks:=0)
Else
Exit Sub
End If