CreateSummary Method
Applies To
Scenarios collection object.
Description
Creates a new worksheet that contains a summary report for the scenarios on the specified worksheet.
Syntax
expression.CreateSummary(ReportType, ResultCells)
expression Required. An expression that returns a Scenarios collection.
ReportType Optional Variant. The report type. Can be one of the following XlSummaryReportType constants: xlStandardSummary or xlSummaryPivotTable. The default value is xlStandardSummary.
ResultCells Optional Variant. A Range object that represents the result cells on the specified worksheet. Normally, this range refers to one or more cells containing the formulas that depend on the changing cell values for your model — that is, the cells that show the results of a particular scenario. If this argument is omitted, there are no result cells included in the report.
Example
This example creates a summary of the scenarios on Sheet1, with result cells in the range C4:C9 on Sheet1.
Worksheets("Sheet1").Scenarios.CreateSummary _
ResultCells := Worksheets("Sheet1").Range("C4:C9")