Skip to main content

Delete column from Excel

Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

This command deletes a specific column from an Excel worksheet. It allows you to remove unwanted columns by specifying either the column letter (A, B, C) or column number (1, 2, 3) within a selected Excel worksheet.


Parameter Values

Input parameters

Parameter

Description

Required

Options / Notes

Excel instance

Please select an Excel instance (created via the "Launch Excel" or "Get active Excel worksheet" command) to identify the instance to operate on.

Yes

Must reference a previously created Excel instance

Worksheet name

Specify the worksheet name (leave blank for the active worksheet)

No

If left blank, the action will use the currently active worksheet

Target column

Specify the column using either a number (1 = first, -1 = last) or a letter (e.g., A, B, C)

Yes

Supports both letter notation (A, B, C) and numeric notation (1, 2, 3); use -1 to target the last column

Error handling

Parameter

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action doesn't produce any variables.


Using Variables in Conditions

When you see the {x} icon next to a parameter field, you can insert variables created by previous actions. This allows you to dynamically specify parameters such as worksheet names or column references based on data from earlier in your workflow. For example, you could use a variable to specify which column to delete based on a calculation or user input captured earlier.


Notes

  • Before using this command, ensure that a valid Excel instance has been created using commands like "Launch Excel" or "Get active Excel worksheet".

  • The target column can be specified using either letter notation (A, B, C) or numeric notation (1, 2, 3).

  • Using -1 as the target column will delete the last column in the worksheet.

  • This operation permanently removes the column and all its data, so ensure you have a backup if needed.

  • If the specified worksheet doesn't exist, the command will result in an error.

Did this answer your question?