Scenarios Method

Applies To

Worksheet Object.

Description

Accessor. Returns an object that represents a single scenario (a Scenario object, Syntax 1) or a collection of scenarios (a Scenarios object, Syntax 2) on the worksheet.

Syntax 1

object.Scenarios(index)

Syntax 2

object.Scenarios

object

Required. The Worksheet object.

index

Required for Syntax 1. The name or number of the scenario (can be an array to specify more than one).

Example

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


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