04 Value - AndrewMB2/Logic-Architect-for-Excel-VBA GitHub Wiki

Value property

Returns or sets the value of a cell or range of cells.

Applies to

TableData ArrData RsetData Xdata XShared

Parameters

Name Type Description
Field Variant Name or number of the field (column) containing the cell to be returned or set.
Row Long Row containing the cell to be returned or set. Can be omitted when setting a value in which case sets in the last row.
Columns Integer (optional) The number of columns. If omitted, assumes only a single cell.

Can be used to return or set the value of a single cell or a range containing several cells in the same row. For a single cell, returns a single value. For a range of more than one cell, returns a 2-dimensional 1-based array with the cells indexed on the second dimension. The same should be used to set values.

When setting values, if setting a single cell and the source value is of type VbString, and the first character is = or ' or the value is a number or a date, a ' character is placed in front of the value. This ensures that the result is text and the value returned will be the same as the value set.

Value should be used when returning or setting cells randomly. If all cells need to be returned or set sequentially, RecValue will be more efficient.

Value is the default property of Tabledata, so a cell value can be returned by writing

ReturnedValue = Td1(Field,Row)