Extract a Table from a Worksheet

Locates and extracts a table from an Excel worksheet.

Overview

This procedure locates and extracts a table from an Excel worksheet.

Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

extract a table from the worksheet

What does it do?

Begins table extraction from the current worksheet.

Where does it go?

This phrase should be written on a new line.

Is it required?

✅ Yes — This phrase is required.

Does it require data?

✅ Yes — A reference to the worksheet must be defined in the automation.

the description is "table-description"

What does it do?

Describes the table to be extracted.

Where does it go?

Indented under extract a table from the worksheet where.

Is it required?

❌ No — This phrase is optional.

Does it require data?

✅ Yes — Replace table-description with a text description of the table you want to extract.

Example

the description is "sales data with monthly totals"
the location is "A1:D10"

What does it do?

Specifies the cell range containing the table.

Where does it go?

Indented under extract a table from the worksheet where.

Is it required?

❌ No — This phrase is optional.

Does it require data?

✅ Yes — Replace A1:D10 with a cell range in Excel format that specifies the top-left and bottom-right corners of the table.

Example

the location is "A1:D10"
the first header is "x"

What does it do?

Specifies the leftmost column header to start extraction.

Where does it go?

Indented under extract a table from the worksheet where.

Is it required?

❌ No — This phrase is optional.

Does it require data?

✅ Yes — Replace x with the name of the first column header.

Example

the first header is "Name"
the last header is "y"

What does it do?

Specifies the rightmost column header to end extraction.

Where does it go?

Indented under extract a table from the worksheet where.

Is it required?

❌ No — This phrase is optional.

Does it require data?

✅ Yes — Replace y with the name of the last column header.

Example

the last header is "Total"

Examples

1. Extract Table by Description

extract a table from the worksheet where
    the description is "This is a table which calculates housing cost information"

2. Extract Table by Cell Range

Extracts a table from a specific cell range.

extract a table from the worksheet where
    the location is "A1:D15"

3. Extract Table by Header Range

Extracts a table between specified column headers.

extract a table from the worksheet where
    the first header is "Employee ID"
    the last header is "Department"

Last updated

Was this helpful?