Used (last row and last column with values) Get last row and last column.(Microsoft Excel Office Scripts)

Japanese version.

Introduction to how to get the last row and last column using Office scripts.


The following syntax is used (Red text indicates variable parts)

// last line
workbook.getWorksheet("Target sheet name").getUsedRange().getRowCount();
// last column
workbook.getWorksheet("Target sheet name").getUsedRange().getColumnCount();

In this example, the number of rows and columns in the last row is obtained.

For those who want to learn Office script effectively

The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Excel Office Script to streamline your workflow.


Office Scripts Articles