Skip to content

Instantly share code, notes, and snippets.

@imamuddinwp
Created November 8, 2020 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save imamuddinwp/64ff6eda91f4439ca1b513dfb98a2a8c to your computer and use it in GitHub Desktop.
Save imamuddinwp/64ff6eda91f4439ca1b513dfb98a2a8c to your computer and use it in GitHub Desktop.
How To Run A Macro At Same Time Across Multiple Workbook Files?
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
@imamuddinwp
Copy link
Author

"Keyword"
"batch edit excel files"
"macro multiple workbooks"
"run macro to another workbook"
"run word macro on all files in folder"
"update vba code in multiple workbooks"
"outlook application filedialog"
"set workbook subscript out of range"
"vba activate workbook by filename"
"this sheet"
"excel macro pull data from another workbook"
"menu option is used to open the subtotals"
"run macro in another workbook without opening"

@imamuddinwp
Copy link
Author

"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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment