abdul hafeel
New Member
- Joined
- Oct 14, 2006
- Messages
- 9
I need to run a uniform macro on several stored in different folders cocurrently. Can this be done
Thanks in advance
Thanks in advance
Sub RunAll()
Dim tFile As String
Dim tBook As String
Dim i As Long
For i = 1 To Sheets("Files").UsedRange.Rows.Count 'Files is the sheet with the list of files
tFile = Sheets("Files").Range("A" & i).Value
If tFile <> "" Then
Workbooks.Open(tFile).Activate
tBook = ActiveWorkbook.Name
Call Macro 'your macro name
Workbooks(tBook).Close SaveChanges:=True
End If
Next i
End Sub