I have tried to write code to open all files containing Template.2020.xlsm in the sub-folders
when running the macro, no files are opened
It would be appreciated if someone could kindly assist me
when running the macro, no files are opened
Code:
Sub OpenFiles ()
Dim MyFolder As String
Dim MyFile As String
MyFolder = "\\dml\sales\" 'Change folder location
MyFile = Dir(MyFolder & "\*template.2020*.xlsm")
Do While MyFile <> ""
Workbooks.Open Filename:=MyFolder & "\" & MyFile
MyFile = Dir
Loop
End Sub
It would be appreciated if someone could kindly assist me