Delete a column
How to delete a single column in a worksheet using Excel, VBA and Shortcut methods
1. Select an entire column where you want to delete a column. Note: in this example we are deleting column (B). To select an entire column, either click on the column heading or select the first cell of the column, press and hold the Ctrl and Shift keys and press the Down key. |
2. Right-click anywhere on the selected column and click Delete. |
METHOD 2. Delete a column using the ribbon option
EXCEL
1. Select any cell in the same column where you want to delete a column. Note: in this example we are deleting column (B), given we have selected a cell in the second column. |
2. Select the Home tab. |
3. Click Delete in the Cells group. 4. Click Delete Sheet Columns. |
METHOD 3. Delete a column using the cell option
EXCEL
1. Right-click on any cell in the column where you want to delete a column. 2. Click Delete Note: in this example we are deleting column (B), given we have right-clicked on a cell in the second column. |
3. Select the Entire column option and click OK group. |
Worksheets("Sheet1").Range("B2").EntireColumn.Delete
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
ADJUSTABLE PARAMETERS
Column Selection: Select the column that you want to delete by changing the column reference ("B2"). You can also change the row reference to any row as this will have no impact on which column will be deleted.
Worksheet Selection: Select the worksheet where you want to delete a column by changing the Sheet1 worksheet name.
Worksheets("Sheet1").Range("B2:B5").EntireColumn.Delete
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
ADJUSTABLE PARAMETERS
Column Selection: Select the column that you want to delete by changing the column reference ("B2:B5"). You can also change the row reference to any row as this will have no impact on which column will be deleted.
Worksheet Selection: Select the worksheet where you want to delete a column by changing the Sheet1 worksheet name.
METHOD 3. Delete a column using VBA by selecting an entire column
VBA
Worksheets("Sheet1").Range("B:B").EntireColumn.Delete
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
ADJUSTABLE PARAMETERS
Column Selection: Select the column that you want to delete by changing the column reference ("B:B").
Worksheet Selection: Select the worksheet where you want to delete a column by changing the Sheet1 worksheet name.
NOTES
To delete a column using this shortcut method you will need to select an entire column. If you select a single cell or a range of cells and action this shortcut a Delete dialog box will appear and you will need to select Entire column and click OK.
This tutorial explains and provides step by step instructions on how to delete a single column in a worksheet using Excel, VBA and Shortcut methods.
Excel Methods: Using Excel you can delete a column by selecting an entire column or a single cell and using a ribbon or cell option.
VBA Methods: Using VBA you can delete a column by referencing to a single cell, a range of cells or an entire column. If you want to delete a single column by referencing to a range of cells you need to ensure that the range of cells only references to a single column. As per the example in this tutorial the VBA code references to only column B across multiple rows ("B2:B5").
Shortcut Methods: Using a Shortcut you can delete a column by selecting an entire column that you want to delete and then actioning the shortcut.
ADDITIONAL NOTES
Note 1: Deleting a column will move the existing columns, that are after the deleted column, leftwards. In this this tutorial every column after column B will be moved leftwards.
Related Topic | Description | Related Topic and Description |
---|---|---|
Insert a column | How to insert a single column in a worksheet using Excel, VBA and Shortcut methods | |
Insert multiple columns | How to insert multiple columns in a worksheet using Excel, VBA and Shortcut methods | |
Delete multiple columns | How to delete multiple columns in a worksheet using Excel, VBA and Shortcut methods | |
Insert a row | How to insert a single row in a worksheet using Excel, VBA and Shortcut methods | |
Insert multiple rows | How to insert multiple rows in a worksheet using Excel, VBA and Shortcut methods |