CB.FormatPrefsND

This subroutine sets format preferences for the forecast corresponding to the selected cell without using the Chart Preferences dialog. The defaults are the current settings on the Axis tab of the Chart Preferences dialog.

Select a forecast cell before calling this subroutine to change the format preferences for a single forecast. If you call this subroutine to change a single forecast chart (All is False) when no forecast cell is selected, CB.MacroResult returns cbErrNoForecastInCell.

See the Oracle Crystal Ball User's Guide for more information on how to format forecast charts.

Table 79. CB.FormatPrefsND Parameters

Parameter

VBA Data Type

Value

Description

Index

Integer

See Table 80 for values

Specifes which forecast chart Axis preference to change. Values appear in Table 80: 1 = cbFmtFormatType, 2 = cbFmtUnderlying, 3 = cbFmtCommas, 4 = cbFmtDecimalPlace.

Value

Variant

See Table 81 for values

Used with the Index parameter to specify forecast chart Axis preference settings. Values appear in Table 81.

All (Optional)

Variant

True or False

True applies this option to all forecasts. False applies this option only to the selected forecast. The default is False.

The Index parameter (Table 80, CB.FormatPrefsND Index parameter values — Required, Integer) works with the Value parameter to set Axis preferences for forecast charts.

Table 80. CB.FormatPrefsND Index parameter values — Required, Integer

Named Constant Value

Index Value

Description

cbFmtFormatType

1

Sets the number format of the axis labels, according to the Value parameter setting

cbFmtUnderlying

2

Sets whether to use the underlying cell format for the axis labels, according to the Value parameter setting. You cannot use any other format preferences unless this option is turned off.

cbFmtCommas

3

Sets whether to use commas (or another thousands separator character indicated in the Windows regional settings) in the axis labels, according to the Value parameter setting. This preference is ignored for scientific notation.

cbFmtDecimalPlace

4

Sets the number of decimal places to use in the axis labels for fixed and scientific number formats, according to the Value parameter setting

The Value parameter (Table 81) works with the Index parameter to set forecast chart Axis preferences.

Table 81. CB.FormatPrefsND Value Parameter Values — Required, Variant

Used With Specified Values of Index

Named Constant or Boolean Value

Index Value

Description

For Index = 1, cbFmtFormatType: Integer

cbFttFixed

1

Sets the axis labels to have a fixed decimal place format

For Index = 1, cbFmtFormatType: Integer

cbFttGeneral

2

Sets the axis labels to be a general Microsoft Excel number format

For Index = 1, cbFmtFormatType: Integer

cbFttScientific

3

Sets the axis labels to appear in scientific notation

For Index =2, cbFmtUnderlying: Boolean

True or False

n/a

True uses the underlying cell format, overriding any other formatting previously set; False uses General formatting

For Index =3, cbFmtCommas: Boolean

True or False

n/a

True uses commas or another thousands separator character in the axis labels; False does not

For Index =4, cbFmtDecimalPlace: Integer

Any whole number up to 232

n/a

Sets the number of fixed decimal places. This works only if you set the format type to cbFttFixed or cbFttScientific.