CB.GetDecVar

This function retrieves information for a specific decision variable cell.

Note:

For best results, always call CB.CheckData before calling this function to ensure the latest data values are used.

Table 110. CB.GetDecVar Returned Data Type

Returned Value

Returned Data Type

The specified decision variable data

Variant

Table 111. CB.GetDecVar Parameters

Parameter

VBA Data Type

Value

Description

DecVarReference

Variant

In a macro: Range("B3")

Points to the desired decision variable cell

Index

Integer

See Table 112.

Returns specified data from the selected decision variable using the constant and index values shown in Table 112

The following table shows named constant and index values for the Index parameter.

Table 112. CB.GetDecVar Index Parameter Values — Required, Integer

Named Constant Value

Index Value

Description

cbDecName

1

Returns the decision variable name

cbDecMin

2

Returns the decision variable minimum (lower) bound

cbDecMax

3

Returns the decision variable maximum (upper) bound

cbDecType

4

Returns the type of decision variable:

0 = Continuous, 1 = Discrete, 2 = Binary, 3 = Category, 4 = Custom.

cbDecStep

5

For discrete variables, this returns the step size

cbDecFrozen

6

Returns whether the decision variable in the selected cell is frozen

cbDecCustomData

7

Returns the custom value list or range if cbDecType = 4, Custom

cbDecCustomDataCount

8

Returns the number of values in the custom value list or range if cbDecType = 4, Custom