Share via


Worksheet.Scenarios Method (Excel)

Returns an object that represents either a single scenario (a Scenario object) or a collection of scenarios (a Scenarios object) on the worksheet.

Syntax

expression .Scenarios(Index)

expression A variable that represents a Worksheet object.

Parameters

Name

Required/Optional

Data Type

Description

Index

Optional

Variant

The name or number of the scenario. Use an array to specify more than one scenario.

Return Value

Object

Example

This example sets the comment for the first scenario on Sheet1.

Worksheets("Sheet1").Scenarios(1).Comment = _ 
 "Worst-case July 1993 sales"

See Also

Concepts

Worksheet Object Members

Worksheet Object