Skip to content

Commit f658188

Browse files
authored
Merge pull request #762 from OfficeDev/main
[admin] Publish
2 parents edf4ad0 + bc91f6c commit f658188

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/tutorials/excel-tutorial.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Tutorial: Create and format an Excel table"
33
description: A tutorial about the basics of Office Scripts, including recording scripts with the Action Recorder and writing data to a workbook.
4-
ms.date: 11/14/2023
4+
ms.date: 09/20/2024
55
ms.localizationpriority: high
66
---
77

@@ -78,7 +78,7 @@ Next, convert this fruit sales data into a table. You'll keep modifying the firs
7878
let table = selectedSheet.addTable("A1:C5", true);
7979
```
8080

81-
1. That call returns a `Table` object. Use that table to sort the data.Sort the data in ascending order based on the values in the "Fruit" column. Add the following line after the table creation:
81+
1. That call returns a `Table` object. Use that table to sort the data. Sort the data in ascending order based on the values in the "Fruit" column. Add the following line after the table creation:
8282

8383
```TypeScript
8484
table.getSort().apply([{ key: 0, ascending: true }]);
@@ -97,14 +97,14 @@ Next, convert this fruit sales data into a table. You'll keep modifying the firs
9797
}
9898
```
9999

100-
Tables have a `TableSort` object, accessed through the `Table.getSort` method. You can apply sorting criteria to that object. The `apply` method takes in an array of `SortField` objects. In this case, you only have one sorting criteria, so you only use one `SortField`. `key: 0` sets the column with the sort-defining values to "0" (which is the first column on the table, **A** in this case). `ascending: true` sorts the data in ascending order (instead of descending order).
100+
Tables have a `TableSort` object, accessed through the `Table.getSort` method. You can apply sorting criteria to that object. The `apply` method takes in an array of `SortField` objects. In this case, you only have one sorting criteria, so you only use one `SortField`. The `key: 0` value sets the column with the sort-defining values to "0" (which is the first column on the table, column **A** in this case). The `ascending: true` value sorts the data in ascending order (instead of descending order).
101101

102102
1. Run the script. You should see a table like this:
103103

104104
:::image type="content" source="../images/tutorial-3.png" alt-text="A worksheet showing the sorted fruit sales table.":::
105105

106106
> [!NOTE]
107-
> If you re-run the script, you'll get an error. This is because you cannot create a table on top of another table. However, you can run the script on a different worksheet or workbook.
107+
> If you re-run the script, you'll get an error. This is because you can't create a table on top of another table. However, you can run the script in a different worksheet or workbook.
108108

109109
### Re-run the script
110110

0 commit comments

Comments
 (0)