CB.CorrelateND

This subroutine defines or updates a correlation coefficient between the assumptions corresponding to two selected cells.

Table 27. CB.CorrelateND Parameters

Parameter

VBA Data Type

Value

Description

Coefficient

Variant

A number between –1.0 and 1.0.

Sets the correlation coefficient between two selected assumptions

SecondAsm (Optional)

Microsoft Excel.Range

A single cell outside of the specified range on the same or another worksheet

Sets a single assumption cell as the second cell to correlate with the first specified cell in a selected range. The second cell specified with SecondAsm should not be part of the selected range and can be on another worksheet in the same workbook.

To specify two assumption cells to correlate, either:

If the cells to correlate are in the lower left (the lowest column and the highest row) and upper right (highest column and lowest row) corners of the selected range, activate one of the cells before calling this subroutine. If the two assumption cells are in the same column or row, the selected cell range is one cell wide or tall. If the cells are adjacent, the selected region has exactly two cells in it.

Unless you are using the SecondAsm parameter, both the selected cell and the opposite corner of the selected range must contain assumption cells. If the selected region is just one cell, use SecondAsm to define a second cell, because you cannot correlate a cell with itself. If there is an error in specifying the cells to be correlated, CB.CorrelateND returns cbErrNoAssumptionInCell. If you enter a number outside the range -1.0 and 1.0, the subroutine deletes any correlation between the cells.

See the Oracle Crystal Ball User's Guide for more information on specifying correlations between assumptions.