Get first free column/row from Excel worksheet Action(Power Automate Desktop)


Japanese version.

The action is to get +1 of the last number of rows and columns where data exists on the active sheet.

This action is often used to retrieve the cell position where data is to be added in Write to Excel worksheet Action and the last cell position to be read in Read from Excel Worksheet Action.

Since the target to retrieve is the active sheet, if there are multiple sheets, you should also specify the sheets in the Set active Excel worksheet Action.

How to use.

Specify the target file in Launch Excel Action or Attach to Running Excel Action and drag Get first free column/row from Excel worksheet Action from Excel onto the workspace.

Set parameters.


Excel instance

Specify the target Excel file.

Specify the Variables produced for the Launch Excel Action or the Attach to running Excel Action.

Variables produced

FirstFreeColumn & FirstFreeRow

FirstFreeColumn is set to the number of columns and FirstFreeRow to the number of rows.

If used for a worksheet like the one below, FirstFreeColumn=6 and FirstFreeRow=7.

When used on a worksheet like the one below, FirstFreeColumn=8 and FirstFreeRow=9

As you can see, even if there are blank rows/columns or rows/columns with half-data, they will still be counted.

On error

Error handling is performed as needed.

Failed to retrieve first free column/row

This is an error when processing fails, such as when data exists up to the last row or column in Excel.



Excel Actions.

Send newsletter. Email one line at a time from an Excel book.

How to convert Excel files to CSV files.

How to get the last row and last column of an Excel book.

Move to the specified cell in the Excel book.

Delete rows of Excel with specific conditions.