All,
I have created a macro to automate a bunch of scenarios I am running in a financial model I've built. The ultimate goal is to automate 30K+ scenarios with my macro. The problem is, the macro I've written (below) is far to slow (it would take me two days at the current speed to run all of the scenarios).
Ultimately, my macro is a simple goal seek (i.e. goal seek the purchase price of an investment that meets a given financial return requirement) that copies and pastes the resulting purchase price to a cell after the goal seek is complete.
GOAL SEEK MACRO:
Sub Sensitivity_Macro()
Dim Macro As Integer
Dim A As Integer
Dim B As Integer
A = Range("Macro_Start")
B = Range("Macro_End")
For Macro = A To B Step 1
Application.Goto Reference:="Macro_No"
ActiveCell.Value = Macro
Range("Min_Delta").GoalSeek Goal:=0, ChangingCell:=Range("Land_Value")
Application.Goto Reference:=("Land_Paste")
ActiveCell.Offset(Macro, 0).Range("a1").Select
Range("Land_Copy").Copy
Selection.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
Next Macro
End Sub
In order for me to accomplish my task, speeding up my macro is a must. My macro needs to calculate each scenario in under 3 seconds for it to make my life easy.
This forum has always been a huge help. Would love to get your ideas once again.
Best Regards,
Chet
I have created a macro to automate a bunch of scenarios I am running in a financial model I've built. The ultimate goal is to automate 30K+ scenarios with my macro. The problem is, the macro I've written (below) is far to slow (it would take me two days at the current speed to run all of the scenarios).
Ultimately, my macro is a simple goal seek (i.e. goal seek the purchase price of an investment that meets a given financial return requirement) that copies and pastes the resulting purchase price to a cell after the goal seek is complete.
GOAL SEEK MACRO:
Sub Sensitivity_Macro()
Dim Macro As Integer
Dim A As Integer
Dim B As Integer
A = Range("Macro_Start")
B = Range("Macro_End")
For Macro = A To B Step 1
Application.Goto Reference:="Macro_No"
ActiveCell.Value = Macro
Range("Min_Delta").GoalSeek Goal:=0, ChangingCell:=Range("Land_Value")
Application.Goto Reference:=("Land_Paste")
ActiveCell.Offset(Macro, 0).Range("a1").Select
Range("Land_Copy").Copy
Selection.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
Next Macro
End Sub
In order for me to accomplish my task, speeding up my macro is a must. My macro needs to calculate each scenario in under 3 seconds for it to make my life easy.
This forum has always been a huge help. Would love to get your ideas once again.
Best Regards,
Chet