CB.DefineForeND

This subroutine defines or changes a forecast in the selected cell without using a dialog.

The selected cell must contain a simple value, an expression, or a cell reference; otherwise, CB.MacroResult returns cbErrNoForecastInCell.

Note:

Before calling this subroutine, select a cell.

Table 57. CB.DefineForeND Parameters

Parameter

VBA Data Type

Value

Description

FName (Optional)

Variant

Title surrounded by quotes ("")

Specifies how Crystal Ball identifies the forecast. If you do not specify a name, Crystal Ball uses the first of either: the cell’s range name, text from the cell in the column immediately preceding it (to the left), text from the cell in the row immediately preceding it (above), or the cell’s coordinates

Units (Optional)

Variant

Words surrounded by quotes ("")

Specifies the units label of the forecast chart

DisplayAuto (Optional)

Variant

True or False

True sets the forecast window to open automatically according to the DisplayWhileRunning setting. False requires you to open the forecast chart manually through the Analyze, then Forecast Charts command. The default is True.

DisplayWhileRunning (Optional)

Variant

True or False

Used only when DisplayAuto is set to True. True for this parameter opens the forecast window at the start of a simulation. False opens the forecast window at the end of a simulation. The default is True.

Obsolete_WindowSize (Optional)

n/a

n/a

This parameter, formerly WindowSize, is obsolete and is no longer available for use. However, if you use one of the following optional parameters, you need to leave a space for it set off by a comma.

LSL (Optional)

Variant

A numeric value (double), a string representing a cell reference (such as “=B1”), or cbParmUndefined

Enters a lower specification limit for the forecast

USL (Optional)

Variant

A numeric value (double), a string representing a cell reference (such as “=B1”), or cbParmUndefined

Enters an upper specification limit for the forecast

Target (Optional)

Variant

A numeric value (double), a string representing a cell reference (such as “=B1”), or cbParmUndefined

Enters a target value for the forecast