I have workbook names in sheet1. I would like to run the macro "Data Export" in each of these workbooks instead of macro below. If A new file/s files are added I need to amend the macro below each time
There could be between 15 -20 workbooks on which to run the macro
It would be appreciated if someone could assist me
There could be between 15 -20 workbooks on which to run the macro
Code:
Sub Export_TB() 's()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
Application.CutCopyMode = False
Windows("M_BR1 ACCNTS(P).xlsm").Activate
Application.Run "'M_BR1 ACCNTS(P).xlsm'!Data Export"
ActiveWorkbook.Close
Windows("M_BR1 ACCNTS(P).xlsm").Activate
ActiveWorkbook.Close
Windows("Open Pull Files.xlsm").Activate
Windows("M_BR2 ACCNTS(P).xlsm").Activate
Application.Run "'M_BR2 ACCNTS(P).xlsm'!Data Export"
ActiveWorkbook.Close
Windows("M_BR2 ACCNTS(P).xlsm").Activate
ActiveWorkbook.Close
Windows("Open Pull Files.xlsm").Activate
Windows("M_BR3 ACCNTS(P).xlsm").Activate
Application.Run "'M_BR3 ACCNTS(P).xlsm'!Data Export"
ActiveWorkbook.Close
Windows("M_BR3 ACCNTS(P).xlsm").Activate
ActiveWorkbook.Close
Windows("Open Pull Files.xlsm").Activate
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.EnableEvents = True
Application.CutCopyMode = False
End Sub
It would be appreciated if someone could assist me
Last edited: