Hi,
I've made the following macro with a loop.
----
Sub Run_model_loop()
For i = 2 To 150
Value = i
ThisWorkbook.Sheets("EVENTS").Calculate
Sheets("SUB2").Rows(i - 1).Calculate
Sheets("SUB2").Rows(i).Calculate
Sheets("SUB3").Rows(i).Calculate
Sheets("SUB4").Rows(i).Calculate
Next i
ThisWorkbook.Sheets("EVENTS").Calculate
ThisWorkbook.Sheets("Order results").Calculate
End Sub
----
Right now the end trigger is when i = 150. However, the end trigger should be a specific end-date (cel B2 of sheet SYSTEM). I would like for the macro to check the date in column C (i.e. request date) of sheet SUB2. When it recalculates a row of SUB2, and the date in column C on that particular row >= the end date (i.e. SYSTEM!B2) then the macro should stop the loop.
Is this possible?
File: Event-Based Sim_(with loop macro).xlsm
Bookmarks