Created
November 8, 2020 09:41
-
-
Save imamuddinwp/64ff6eda91f4439ca1b513dfb98a2a8c to your computer and use it in GitHub Desktop.
How To Run A Macro At Same Time Across Multiple Workbook Files?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Run_Macro_Dir() | |
' | |
' Macro for running on multiple files in seleted folder. | |
' | |
' Imam Uddin; | |
' | |
'https://github.com/imamuddinwp | |
' | |
' | |
Dim xFd As FileDialog | |
Dim xFdItem As Variant | |
Dim xFileName As String | |
Set xFd = Application.FileDialog(msoFileDialogFolderPicker) | |
If xFd.Show = -1 Then | |
xFdItem = xFd.SelectedItems(1) & Application.PathSeparator | |
xFileName = Dir(xFdItem & "*.xls*") | |
Do While xFileName <> "" | |
With Workbooks.Open(xFdItem & xFileName) | |
'Your All Codes Here | |
'Your All Codes Here | |
End With | |
xFileName = Dir | |
Loop | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"Keyword"
"run macro on all word files in folder"
"run same macro on multiple excel files"
"batch edit excel files"
"eapp vba"
"macro multiple workbooks"
"run macro to another workbook"
"vba for each folder in"
"excel loop through folders"
"excel vba search for file"
"vba loop through files in folder and copy"
"excel vba list files in folder and subfolder"
"vba find file in folder with partial name"
"how to run macro on multiple excel files"
"run macro on selected sheets"
"google sheets macros for multiple sheets"
"how to make a macro work for all worksheets"
"how to make vba code apply to all worksheets"