CreateSummary Method

Microsoft Excel Visual Basic

CreateSummary Method

       

Creates a new worksheet that contains a summary report for the scenarios on the specified worksheet. Variant.

expression.CreateSummary(ReportType, ResultCells)

expression   Required. An expression that returns one of the objects in the Applies To list.

ReportType  Optional XlSummaryReportType.

XlSummaryReportType can be one of these XlSummaryReportType constants.
xlSummaryPivotTable
xlStandardSummary default

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")