Get first free column/row from Excel worksheet Action(Power Automate Desktop)
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.
- 1. How to use.
- 2. Links
- 2.1. Excel Actions.
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.
Specify the target Excel file.
Specify the Variables produced for the Launch Excel Action or the Attach to running Excel Action.
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.
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.