Skip to main content

Get table range

Return the address of the smallest rectangle holding all data on the sheet (including pivot tables), or of a named Excel table or pivot table, e.g. A1:D20.

Command in the Excel toolkit · id ooa.excel/get_table_range · 5 inputs, 3 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
SheetStringNoSheet name; active sheet when empty.
SessionStringNoexcelWorkbook session.
TableStringNoExcel table or pivot table name, e.g. Table1 or PivotTable1; the sheet's used area when empty.
Include headerBooleanNotrueFor an Excel table, include its header row in the range.
Include pivot tablesBooleanNotrueCount the whole area of the sheet's pivot tables (with their filter fields) as data, even cells Excel has not filled in yet.

Outputs​

OutputTypeWhat it is
rangeStringUsed range address; empty when the sheet is empty.
rowsNumberNumber of rows in the range.
columnsNumberNumber of columns in the range.