Dear VBA Masters,
I'm doing my first steps in VBA and I am stuck for days now with something that might have
a simple solution.
I have built a Solver macro, that is running and attached to a button in a sheet named "Consolidated Financials". It helps me to optimize some financial parameters in a large sheet with many financial calculations.
I prepared a summary of the key numbers in a new sheet named "Dashboard". I need to copy that macro/button from "Consolidated Financials" to "Dashboard" sheet in a way, that when I click the Solver button in "Dashboard" it runs Solver in "Consolidated Financials", without jumping to that sheet.
Everything is in same workbook and all assumptions for Solver are in "Consolidated Financials" tab.
I would really appreciate your help! I seem to be in a pickle here. Thank you!
The code I'm using inside "Consolidated Financials" sheet is following:
Sub SolverMacro()
'
' SolverMacro Macro
'
'
SolverReset
SolverAdd CellRef:="$F$111", Relation:=2, FormulaText:="$G$347"
SolverAdd CellRef:="$G$332", Relation:=2, FormulaText:="$G$346"
SolverOk SetCell:="$G$334", MaxMinVal:=2, ValueOf:=0, ByChange:="$G$352,$F$189" _
, Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve
End Sub
I'm doing my first steps in VBA and I am stuck for days now with something that might have
a simple solution.
I have built a Solver macro, that is running and attached to a button in a sheet named "Consolidated Financials". It helps me to optimize some financial parameters in a large sheet with many financial calculations.
I prepared a summary of the key numbers in a new sheet named "Dashboard". I need to copy that macro/button from "Consolidated Financials" to "Dashboard" sheet in a way, that when I click the Solver button in "Dashboard" it runs Solver in "Consolidated Financials", without jumping to that sheet.
Everything is in same workbook and all assumptions for Solver are in "Consolidated Financials" tab.
I would really appreciate your help! I seem to be in a pickle here. Thank you!
The code I'm using inside "Consolidated Financials" sheet is following:
Sub SolverMacro()
'
' SolverMacro Macro
'
'
SolverReset
SolverAdd CellRef:="$F$111", Relation:=2, FormulaText:="$G$347"
SolverAdd CellRef:="$G$332", Relation:=2, FormulaText:="$G$346"
SolverOk SetCell:="$G$334", MaxMinVal:=2, ValueOf:=0, ByChange:="$G$352,$F$189" _
, Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve
End Sub