I have written code to open up all the files in C:\Sales Reports containing the text "OBS"
when running the macro, nothing happens
kindly amend my code so that all files containing text OBS for eg CT Sales Obsolesence Jan 2018, BT Sales Obsolesense for Jan 2018 etc is opened
when running the macro, nothing happens
kindly amend my code so that all files containing text OBS for eg CT Sales Obsolesence Jan 2018, BT Sales Obsolesense for Jan 2018 etc is opened
Code:
Sub OpenFiles()
Dim MyFolder As String
Dim MyFile As String
MyFolder = "C:\Sale Reports"
MyFile = Dir(MyFolder & "\*obs*.xls")
Do While MyFile <> ""
Workbooks.Open Filename:=MyFolder & "\" & MyFile
Loop
End Sub