Description
Represents a scenario on a worksheet. A scenario is a group of input values (called changing cells) that is named and saved.
Accessors
The Scenario object is a member of the Scenarios collection. The Scenarios collection contains all of the defined scenarios for a worksheet. Use the Add method to create a new scenario and add it to the collection. To access a single member of the collection, use the Scenarios method with the index number or name of the scenario as an argument.
You assign a name to a scenario when you create it. Use the Name property to set or return the scenario name. The following example shows the scenario named "Typical" on the worksheet named "Options."
Worksheets("options").Scenarios("typical").Show
Scenario names are shown in the Scenario Manager dialog box and in the Scenarios box on the Workgroup toolbar. The first scenario created is at the top of the list; the last scenario is at the bottom (they are not sorted by alphabetical order). This is also the order used for the scenario index numbers. The first scenario created is Scenarios(1); the last scenario is Scenarios(Scenarios.Count). The following example hides scenario one for the worksheet named "Options." When the worksheet is protected, this scenario will not be visible in the Scenarios box or the Scenario Manager dialog box.
Worksheets("options").Scenarios(1).Hidden = True
Properties
Application Property, ChangingCells Property, Comment Property, Creator Property, Hidden Property, Index Property, Locked Property, Name Property, Parent Property, Values Property.
Methods
ChangeScenario Method, Delete Method, Show Method.