04 Initialise - AndrewMB2/Logic-Architect-for-Excel-VBA GitHub Wiki
Initialise method
Initialises a TableData object. Returns True if successful, otherwise False.
Applies to
| TableData | ArrData | RsetData | Xdata | XShared |
|---|---|---|---|---|
| ✓ |
Parameters
| Name | Type | Description |
|---|---|---|
| TableRange | Range | The range to be used, the header row, or the first cell of the header row (depending on the ExtendAcross or ExtendDown parameters, see below). |
| AllowNull | Boolean (optional) | Allows a range with no data (otherwise an error will be given). |
| ExtendAcross | Boolean (optional) | Extends TableRange to the right to the last header cell containing data. |
| ExtendDown | Boolean (optional) | Extends TableRange down to the last row containing data in any column (if a table, extends to the last row of the table if nothing below the table but does not change size of the table). |
| IgnoreDupHeaders | Boolean (optional) | Allows duplicate values in the headers. Only the first occurrence can be referenced by name, subsequent occurrences can be referenced by number, or GetHeader can be used to give the column a unique name. |
Most commonly a TableData object will represent an existing data array or table on a worksheet. This must be set up with a single header row which supplies the names of the fields/columns. Use the Initialise method as the first method on the TableData object you have defined, specifying the range where the data is placed.
In tables, totals rows are recognised and protected and do not form part of the data.
If a table or there is at least one row of data, formulas are remembered by Initialise and can be restored with the FormulaFill method. Numberformats are remembered (from the row below the header row) and can be restored with the NumFormatFill method.