Skip to content

[Excel] (Tables) Refresh table combination sample #796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/resources/samples/copy-tables-combine.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Combine data from multiple Excel tables into a single table
description: Learn how to use Office Scripts to combine data from multiple Excel tables into a single table.
ms.date: 06/29/2021
ms.date: 08/14/2025
ms.localizationpriority: medium
---

# Combine data from multiple Excel tables into a single table

This sample combines data from multiple Excel tables into a single table that includes all the rows. It assumes that all tables being used have the same structure.
This sample shows how to combine data from multiple Excel tables into a single table that includes all the rows. It assumes that all the tables being used have the same structure.

There are two variations of this script:

Expand Down Expand Up @@ -49,7 +49,7 @@ function main(workbook: ExcelScript.Workbook) {
let dataValues = table.getRangeBetweenHeaderAndTotal().getTexts();
let rowCount = table.getRowCount();

// If the table is not empty, add its rows to the combined table.
// If the table isn't empty, add its rows to the combined table.
if (rowCount > 0) {
combinedTable.addRows(-1, dataValues);
}
Expand Down