Additional actions and features
Write data to the first available cell
Get the first free column/row
To write data to the first available cell in a given column, we have to first figure out the first free row in a column. We can use the Get first free column/row from Excel worksheet action for this purpose. You can toggle whether you want the column or the row, but by default, it's both. This function produces two variables that you can use for subsequent actions.
Use the selected cell as a reference
Use the Get selected cell range from Excel worksheet action to find out which cells are currently selected. This gives you the indices of the first and last columns and rows of the selected range.
Changing the selected cells
- Use the Select cells in Excel worksheet action to change which cells are selected.
- You can specify a range by providing the coordinates of the upper-left and bottom-right corners of the selection.
- Alternatively, you can select a range of cells relative to the currently active cell.
Alternatively, set the Select option to Range of cells relative to active cell to select many cells from the currently selected cell.
Activating a Specific Cell
To activate a particular cell, use the Activate cell in Excel worksheet action. In the Activate field, you can either choose to specify a cell by its coordinates (Absolutely specified cell) or relative to the currently active cell (Relatively specified cell).
Inserting and Deleting Rows and Columns
It's also possible to insert and delete columns and rows by using the appropriate actions; however, you're required to specify a column or row index. In insertion, the row or column is added before the one that is specified.
Resizing Columns or Rows
It's now possible to resize the selection of columns or rows in the active worksheet of an Excel instance
Run Excel Macros
The Run Excel macro action runs a specified macro saved in the workbook. Specify the name of the macro and any parameters separated by semicolons (;).
For example, a workbook used by the sales department at Contoso Inc. contains a macro called OrderStatus. The macro requires two arguments, the order number and the username, and returns a customer's order status. To look up order number 778 for the username Rbotas, the Macro field in the properties of the action would have to be formatted as follows:
OrderStatus;778;Rbotas
To use variables rather than providing values directly, format the input as follows:
%MacroName%;%OrderNumber%;%UserName%
For more information, see Excel Actions.