# SolverFinish 函數SolverFinish Function

SolverFinishKeepFinalReportArrayOutlineReportsSolverFinish(KeepFinal, ReportArray, OutlineReports)

KeepFinal選用的VariantKeepFinal Optional Variant. 可以是 1 或 2。Can be either 1 or 2. 如果**KeepFinal** 為1或省略，則會將最終的求解值保留在變數儲存格中，取代任何先前的值。If KeepFinal is 1 or omitted, the final solution values are kept in the changing cells, replacing any former values. 如果**KeepFinal** 是2，則會丟棄最後的解決方案值，而且會還原先前的值。If KeepFinal is 2, the final solution values are discarded, and the former values are restored. ReportArray選用的VariantReportArray Optional Variant. 規劃求解完成時，Excel 會建立的報告類型：The kind of report that Excel will create when Solver is finished:

• 如果使用 Simplex LP 或 GRG Nonlinear Solving 方法，1 會建立運算結果報表，2 會建立敏感度報表，而 3 會建立極限值報表。When the Simplex LP or GRG Nonlinear Solving method is used, 1 creates an Answer report, 2 creates a Sensitivity report, and 3 creates a Limit report.

• 如果使用 Evolutionary Solving 方法，1 會建立運算結果報表，而 2 會建立母體報表。When the Evolutionary Solving method is used, 1 creates an Answer report, and 2 creates a Population report.

• 當**SolverSolve** 傳回5時（規劃求解找不到可行的方案），1會建立可行性報告，而2會建立可行性界限報告。When SolverSolve returns 5 (Solver could not find a feasible solution), 1 creates a Feasibility Report, and 2 creates a Feasibility-Bounds report.

• 如果 SolverSolve 傳回 7 (未滿足線性條件)，1 會建立線性報表。When SolverSolve returns 7 (the linearity conditions are not satisfied), 1 creates a Linearity report.

## 範例Example

``````Worksheets("Sheet1").Activate