I have multiple macros within a workbook that I am looking to combine so they can run simultaneously. This is an example of an individual macro which places outputs into a tab named "Game 1":
Sub Game1()
Dim StartTime As Double
Dim SecondsElapsed As Double
StartTime = Timer
Application.Calculation = xlCalculationManual
Dim ITERATIONS
ITERATIONS = ThisWorkbook.Sheets("INPUT").Cells(14, 3)
For j = 5 To ITERATIONS
Application.Calculate
With Sheets("Game 1")
.Cells(j, 1) = Sheets("INPUT").Cells(2, 23)
.Cells(j, 2) = Sheets("INPUT").Cells(3, 23)
.Cells(j, 3) = Sheets("INPUT").Cells(4, 23)
.Cells(j, 4) = Sheets("INPUT").Cells(5, 23)
.Cells(j, 5) = Sheets("INPUT").Cells(6, 23)
End With
Next j
Application.Calculation = xlCalculationAutomatic
SecondsElapsed = Round(Timer - StartTime, 2)
MsgBox "This code ran successfully in " & SecondsElapsed & " seconds", vbInformation
End Sub
I have the same code for Games 2 - 9 which send outputs to their respective tabs when ran individually.
I am looking to combine into one macro that spits outputs onto 9 different tabs simultaneously.
Any help would be greatly appreciated.
Thanks!
Sub Game1()
Dim StartTime As Double
Dim SecondsElapsed As Double
StartTime = Timer
Application.Calculation = xlCalculationManual
Dim ITERATIONS
ITERATIONS = ThisWorkbook.Sheets("INPUT").Cells(14, 3)
For j = 5 To ITERATIONS
Application.Calculate
With Sheets("Game 1")
.Cells(j, 1) = Sheets("INPUT").Cells(2, 23)
.Cells(j, 2) = Sheets("INPUT").Cells(3, 23)
.Cells(j, 3) = Sheets("INPUT").Cells(4, 23)
.Cells(j, 4) = Sheets("INPUT").Cells(5, 23)
.Cells(j, 5) = Sheets("INPUT").Cells(6, 23)
End With
Next j
Application.Calculation = xlCalculationAutomatic
SecondsElapsed = Round(Timer - StartTime, 2)
MsgBox "This code ran successfully in " & SecondsElapsed & " seconds", vbInformation
End Sub
I have the same code for Games 2 - 9 which send outputs to their respective tabs when ran individually.
I am looking to combine into one macro that spits outputs onto 9 different tabs simultaneously.
Any help would be greatly appreciated.
Thanks!