I am trying to run a macro calling the Solver functions on multiple sheets. The Solver area works on a single sheet, but returns the error message on the 5 worksheets I am attempting to calculate. Any advice is most welcome. Also, running this macro switched calculation mode to Manual. I have set up a personal.xlab per instructions, and added the application. Calculation = xlAutomatic .
Sub Solverv2()
Dim xSh As Worksheet
Application.ScreenUpdating = True
For Each xSh In Worksheets
xSh.Select
Call RunCode
Next
Application.ScreenUpdating = True
End Sub
Sub RunCode()
Application.Calculation = xlAutomatic
SolverOptions Precision:=0.001
SolverOK SetCell:="$B$17", MaxMinVal:=3, ValueOf:="$B$7", ByChange:="$B$22"
SolverSolve UserFinish:=False
End Sub
Sub Solverv2()
Dim xSh As Worksheet
Application.ScreenUpdating = True
For Each xSh In Worksheets
xSh.Select
Call RunCode
Next
Application.ScreenUpdating = True
End Sub
Sub RunCode()
Application.Calculation = xlAutomatic
SolverOptions Precision:=0.001
SolverOK SetCell:="$B$17", MaxMinVal:=3, ValueOf:="$B$7", ByChange:="$B$22"
SolverSolve UserFinish:=False
End Sub