ICrossTable
Defines the public contract for the CrossTable class. Exposes properties for table geometry (rows, columns, ranges) and methods for building, formatting, and naming the cross-table on an analysis output worksheet.
Methods
AddRows #
Add row headers and row category labels to the worksheet
Signature:
Public Sub AddRows(): End Sub
Operations for building and formatting the cross-table. Writes the row variable label and all row category values into the first column of the cross-table region. Includes optional total and missing rows based on the table specification flags.
AddColumns #
Add column headers and column category labels to the worksheet
Signature:
Public Sub AddColumns(): End Sub
Writes the column variable label and all column category values into the header row of the cross-table region. Includes optional total and missing columns based on the table specification flags.
AddHeader #
Add the table title and header to the worksheet
Signature:
Public Sub AddHeader(): End Sub
Writes the table title cell above the cross-table and any section header when IsNewSection is True. Positions the header based on the start row computed from the previous table.
NameRanges #
Create all named ranges for the table data regions
Signature:
Public Sub NameRanges(): End Sub
Defines workbook-level named ranges for the row categories, column headers, data body, total row, total column, and other structural regions. The names follow a convention based on the table identifier and are registered in NamedRangesList for export tracking.
Build #
Build the complete cross-table on the worksheet
Signature:
Public Sub Build(): End Sub
Orchestrates the full table construction by calling AddHeader, AddRows, AddColumns, and NameRanges in sequence. This is the primary entry point for AnalysisOutput when building analysis tables.
Format #
Apply formatting to the table using design specifications
Signature:
Public Sub Format(ByVal designFormat As ILLFormat): End Sub
Applies visual formatting (borders, fills, fonts, number formats) to the cross-table cells using the provided ILLFormat design specification. Handles header rows, data cells, total rows, and percentage columns according to the table scope.
Parameters:
designFormat: ILLFormat. The formatting specification to apply.
Properties
HeaderRange #
Header range of the table on the output worksheet
Signature:
Public Property Get HeaderRange() As Range: End Property
Read-only accessors for table geometry, navigation, and metadata. Returns the Range spanning the column headers of the built cross-table. Used by formatting and formula-writing routines to locate header cells.
Returns: Range. The header row range.
RowsCategoriesRange #
Row categories range with optional filtering
Signature:
Public Property Get RowsCategoriesRange( _
Optional ByVal includeHeaders As Boolean = True, _
Optional ByVal onlyCategories As Boolean = False) As Range
Returns the Range spanning the row category labels. When includeHeaders is True, the header row is included. When onlyCategories is True, only the category label column is returned without accompanying data columns.
Parameters:
includeHeaders: Optional Boolean. When True, includes the header row in the returned range. Defaults to True.onlyCategories: Optional Boolean. When True, returns only the label column. Defaults to False.
Returns: Range. The row categories range.
ColumnRange #
Column data range for a specific column value
Signature:
Public Property Get ColumnRange(ByVal colVal As String, _
Optional ByVal onlyCategories As Boolean = False, _
Optional ByVal includeHeaders As Boolean = False) As Range
Returns the Range spanning a single data column identified by its header value. Used by formula writers to target a specific column when building COUNTIFS or SUMPRODUCT expressions.
Parameters:
colVal: String. The column header value to locate.onlyCategories: Optional Boolean. When True, returns only the category cells. Defaults to False.includeHeaders: Optional Boolean. When True, includes the header cell. Defaults to False.
Returns: Range. The data range for the specified column.
RowRange #
Row data range for a specific row value
Signature:
Public Property Get RowRange(ByVal rowVal As String, _
Optional ByVal includeHeaders As Boolean = True) As Range
Returns the Range spanning a single data row identified by its row label value. Used by formula writers to target a specific row when building cross-table expressions.
Parameters:
rowVal: String. The row label value to locate.includeHeaders: Optional Boolean. When True, includes the row label cell. Defaults to True.
Returns: Range. The data range for the specified row.
StartRow #
Starting row of the table on the output worksheet
Signature:
Public Property Get StartRow() As Long: End Property
Returns the 1-based row index where this cross-table begins. Computed from the previous table end row or the section start row when this is the first table.
Returns: Long. The starting row index.
Previous #
Previous cross-table in the same section
Signature:
Public Property Get Previous() As ICrossTable: End Property
Returns the ICrossTable instance that precedes this one in the build chain. Returns Nothing when this is the first table in its section. Used to compute start-row offsets for stacked tables.
Returns: ICrossTable. The preceding cross-table, or Nothing.
Specifications #
Table specifications used to build this cross-table
Signature:
Public Property Get Specifications() As ITableSpecs: End Property
Returns the ITableSpecs instance that defines the configuration for this cross-table. Provides access to table scope, variable names, category lists, and validation flags.
Returns: ITableSpecs. The backing table specification.
Wksh #
Output worksheet where the table is built
Signature:
Public Property Get Wksh() As Worksheet: End Property
Returns the Worksheet reference where this cross-table writes its headers, row labels, column labels, and data cells.
Returns: Worksheet. The output worksheet.
NumberOfColumns #
Number of data columns in the table
Signature:
Public Property Get NumberOfColumns() As Long: End Property
Returns the count of data columns excluding the row-label column. For bivariate and time series tables this equals the number of column categories plus optional total and missing columns.
Returns: Long. The data column count.
EndColumn #
Last column used by the table on the worksheet
Signature:
Public Property Get EndColumn() As Long: End Property
Returns the 1-based column index of the rightmost cell occupied by this cross-table. Used by sibling tables and formatting routines to avoid overlapping output.
Returns: Long. The ending column index.
EndRow #
Last row used by the table on the worksheet
Signature:
Public Property Get EndRow() As Long: End Property
Returns the 1-based row index of the bottommost cell occupied by this cross-table. Used to compute the start row for the next stacked table.
Returns: Long. The ending row index.
TimeSeriesHeader #
Header label for time series tables
Signature:
Public Property Get TimeSeriesHeader() As String: End Property
Returns the translated header text used for the time-period column in time series cross-tables. Returns an empty string for non-time-series table scopes.
Returns: String. The time series column header label.
NamedRangesList #
List of named range names created by this table
Signature:
Public Property Get NamedRangesList() As BetterArray: End Property
Returns a BetterArray containing all the named range names that NameRanges created for this cross-table. Used by AnaTabIds to register the ranges for export tracking.
Returns: BetterArray. The collection of named range names.