CB.EnumCorrelation

This function lists correlated assumption cells and their correlation values for all open workbooks. This command is useful for determining what correlated assumptions have been defined for the open workbooks. You could then call CB.GetAssum for each assumption to retrieve specific information—for example, distribution type and parameters.

Table 62. CB.EnumCorrelation Returned Data Type

Returned Value

Returned Data Type

The current count of correlations left in the enumeration (including the correlation returned by this call)

Variant

Note:

For best results, call CB.CheckData once at the beginning of an enumeration to reset the sequence of correlated assumptions. You should also call CB.CheckData each time you add or delete data. Use CB.CheckData or CB.CheckDataND with CB.MacroResultDetail to check for errors. For more information, see the descriptions of those calls.

If the returned string is 0, all correlated assumptions have been enumerated.

You can only call this function from a subroutine or another function. You cannot call this function from a worksheet.

Table 63. CB.EnumCorrelation Parameters

Parameter

VBA Data Type

Description

Assum1

String

Represents the first assumption in a pair of correlated assumptions, by reference, returned as the absolute cell reference of the next correlated assumption, in the format: '[workbook]sheet'!$A$1

Assum2

String

Represents the second assumption in a pair of correlated assumptions, by reference, returned as the absolute cell reference of the next correlated assumption, in the format: '[workbook]sheet'!$A$1

Value

Variant

Represents the correlation value associated with Assum1 and Assum2, by reference

Notice that all parameters are “by reference.” The values passed into CB.EnumCorrelation are ignored. The next set of enumeration values is assigned to the parameters when the function returns.