Value Property

Returns the numeric value of the current cell.

Syntax

val# = [form!]VSFlexGrid.Value

Remarks

This property is similar to Visual Basic's Val function, except it interprets localized thousand separators, currency signs, and parenthesized negative values. For example, if the current cell contains the string "$(1,234.56)", the Value property will return the value -1234.56.

The following code outputs the value of the current cell to the debug window:

    Private Sub Command1_Click()

        Debug.Print fg.Value

    End Sub

To retrieve the value of an arbitrary cell without selecting it first, use the Cell(flexcpValue) or the ValueMatrix properties.

Note

This property is not an expression evaluator. If the current cell contains the string "2+2", for example, the Value property will return 2 instead of 4. The Visual Basic statement Val("2+2") also returns 2.

Data Type

Double

See Also

VSFlexGrid Control