I have a Master Macro workbook which consists of multiple macros, basically it consists of a Generate Separate Files worksheet which has a dropdown to select a specific values and there is button next to that cell to run macro for the selected value, so the moment I select the value in the Generate Files worksheet cell and hit run macro button, it first does the save as of the master macro file itself with the name/value I had selected in the cell and then filters out the data from each of the worksheets in the master macro workbook to retain only the data of the selected value, so like this I have to open the master macro file workbook multiple times select the value in Generate Separate Files worksheet cell and click run macro. I want to create another macro workbook which can open the master macro workbook select value in the validation dropdown of “Generate Separate Files Worksheet” and run the macro for each value and generate the separate files for each selected files.
Dim wb1 as workbook
Dim wb2 as workbook
Dim sht1 as worksheet
Dim sht2 as worksheet
Dim myrange as Range
Set wb1 = ThisWorkbook
Set wb2 = Workbooks("Master Macro File")
Set sht1 = ThisWorkbook.Sheets("Run Marco")
Set sht2 = Workbooks("Master Macro File").Sheets("Generate Separate Files")
Set myrange = Workbooks("Master Macro File").Sheets("Generate Separate Files").Range("A11").Value
wb2.Select
sht2.select
myrange.select
myrange.value = "File1"
call File1Macro
'wait for the macro to run and the workbook to get saved as File1 then run another macro
wb1.Activate
wb2.Select
sht2.select
myrange.select
myrange.value = "File2"
call File2Macro
'wait for the macro to run and the workbook to get saved as File2 then run another macro
wb2.Select
sht2.select
myrange.select
myrange.value = "File3"
call File3Macro
'wait for the macro to run and the workbook to get saved as File3 then run another macro
wb2.Select
sht2.select
myrange.select
myrange.value = "File4"
call File4Macro
'wait for the macro to run and the workbook to get saved as File4 then run another macro
wb2.Select
sht2.select
myrange.select
myrange.value = "File5"
call File5Macro
'wait for the macro to run and the workbook to get saved as File5 then run another macro
This needs to run for all the values which are in the validation dropdown of myrange .i.e. 25 files