Presentation is loading. Please wait.

Presentation is loading. Please wait.

Running Solver through a Macro Solver dialog box must have been opened at least once in current Excel session (i.e. Solver must be currently activated.

Similar presentations


Presentation on theme: "Running Solver through a Macro Solver dialog box must have been opened at least once in current Excel session (i.e. Solver must be currently activated."— Presentation transcript:

1 Running Solver through a Macro Solver dialog box must have been opened at least once in current Excel session (i.e. Solver must be currently activated in Excel) SolverSolve UserFinish:=True Tools Reference option in VBA must have Solver selected Other VBA commands for controlling Solver in class handout

2 Debugging VBA Code When VBA encounters a problem, it will highlight line in yellow. Use [f8] key to step through code Use the Reset icon button (square) at top of VBA to exit step-through mode and trouble- shoot code or Excel/VBA settings. Cannot retry macro until yellow highlight is gone.

3 Plotting the Efficient Frontier – Version 1A Command Button Private Sub EfficientFrontier_Click() Range("C53") = Range("B59") SolverSolve UserFinish:=True Range("D59") = Range("C51") End Sub

4 Plotting the Efficient Frontier – Version 1B Command Button Private Sub EfficientFrontier_Click() For unit = 1 To 11 Range("C53") = Range("B" & 58 + unit) SolverSolve UserFinish:=True Range("D" & 58 + unit) = Range("C51") Next unit End Sub

5 Running Macros Run Macro option Shortcut Keys: [Ctrl][Shift] letter Command Buttons Custom Toolbar


Download ppt "Running Solver through a Macro Solver dialog box must have been opened at least once in current Excel session (i.e. Solver must be currently activated."

Similar presentations


Ads by Google