Hi,
I'm having a macro that loops through all files in a specific folder.
part of the code is
strMyFile = Dir(strMyDirectory & "*.xls*")
Do Until strMyFile = ""
Set wrkTargetWrkBook = Workbooks.Open(strMyDirectory & strMyFile)
If InStr(wrkTargetWrkBook.Name, " ") > 0 Then
Application.Run ("'" & wrkTargetWrkBook.Name & "'!" & strMyMacro)
Else
Application.Run (wrkTargetWrkBook.Name & "!" & strMyMacro)
End If
Application.EnableEvents = False 'do not run macro at events such as closing
ActiveWorkbook.Close True
strMyFile = Dir
Loop
could I make the loop skip one of the files (master.xls) so that the action are not performed in that file?
Thanks,
Martin
Bookmarks