03.06 Manipulating Data on Worksheets - AndrewMB2/Logic-Architect-for-Excel-VBA GitHub Wiki
Manipulating Data on Worksheets
In addition to the methods described on the preceding pages, TableData provides a number of methods specifically for manipulating tabular data (whether or not in a table) on worksheets. Structural changes to the TableData object range should not be made directly (i.e. not using these methods) as the TableData object will not then work correctly.
| Name | Function |
|---|---|
| SheetName | Returns the sheet name. |
| GetUnique | Gets the unique values in one or more columns (as a zero-based array of strings). Criteria can be specified. If no columns are specified, returns row numbers of rows which match Criteria. |
| Find | Gets the row containing the first occurrence of a value in a given column (finds the whole value in cell values). |
| ReplaceAll | Replaces all occurrences of a value in a given column. |
| CountGroup | Counts the adjacent cells in the given column with the same value as the cell represented by the given row. |
| Sort | Sorts on up to three keys. If more than three, run twice with the least significant keys first. |
| SetBorders | Sets all borders (headers optional). |
| DataRange | Returns the data range. |
| GetRange | Returns the complete range including headers and data. |
| Compare | Compares two rows for the given columns. |
| CheckBlank | Checks if all the cells in the specified row are empty, empty strings, | or 0. |
| AdvancedFilter | Runs an Excel advanced filter with this TableData object as destination. |
| RemoveSubtotal | Removes subtotals. |
| Subtotal | Creates subtotals using the Excel range Subtotal method. Sometimes this can be very slow, so ArrData also provides a simple Subtotal method for totals placed below the data, which can be used immediately before copying the data to a TableData object. |
| PageBreak | Inserts page breaks on change of a given column. |
| ToHeader | Converts a column to headers by inserting a row at each change of value and placing the new value in this row, with subsequent entries in the column blank until the next change. Normally the column would be narrow, giving a slightly indented effect. |
| SaveXML | Saves as a XML file in PersistXML format. Note - this is different from the XML format used by Excel XML procedures. Saves in a XML file or in a DOMDocument object. |
| OpenXML | Opens a XML file or DOMDocument object in PersistXML format and creates the TableData object from the contents. RsetData is required. |