Delete multiple columns
How to delete multiple columns in a worksheet using Excel, VBA and Shortcut methods
1. Select the number of columns you want to delete. Note: in this example we are deleting three columns (columns B, C and D). To select entire columns, either click on the first column heading and drag to the side until you reach the number of columns you want to delete or select the first cell of the column, press and hold the Ctrl and Shift keys and press the Down key, then release the Ctrl key (still holding the Shift key) and press the Right or Left key to select the number of columns you want to delete. |
2. Right-click anywhere on any of the selected columns and click Delete. |
METHOD 2. Delete multiple columns using the ribbon option
EXCEL
1. Select the cells where you want to delete columns. Note: in this example we are deleting three columns (columns B, C and D). You can select multiple cells across separate columns and rows (e.g. B4, E7, G9) which will delete columns B, E and G. |
2. Select the Home tab. |
3. Click Delete in the Cells group. 4. Click Delete Sheet Columns. |
METHOD 3. Delete multiple columns using the cell option
EXCEL
1. Select the cells where you want to delete columns. Note: in this example we are deleting three columns (columns B, C and D). You can select multiple cells across separate columns and rows (e.g. B4, E7, G9) which will delete columns B, E and G. |
2. Right-click on any of the selected cells. 3. Click Delete |
4. Select the Entire column option and click OK group. |
Worksheets("Sheet1").Range("B2:D2").EntireColumn.Delete
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
ADJUSTABLE PARAMETERS
Columns Selection: Select the columns that you want to delete by changing the column references ("B2:D2"). The column selection doesn't need to be in a single range. You can replace the range reference with, for example, ("B4,E7,G9") which will delete columns B, E and G.
Worksheet Selection: Select the worksheet where you want to delete columns by changing the Sheet1 worksheet name.
METHOD 2. Delete multiple columns using VBA by selecting an entire columns
VBA
Worksheets("Sheet1").Range("B:D").EntireColumn.Delete
End Sub
Worksheets: The Worksheets object represents all of the worksheets in a workbook, excluding chart sheets.
ADJUSTABLE PARAMETERS
Columns Selection: Select the columns that you want to delete by changing the column references ("B:D"). The column selection does't need to be in a single range. You can replace the range reference with, for example, ("B:B,E:E,G:G") which will delete columns B, E and G.
Worksheet Selection: Select the worksheet where you want to delete columns by changing the Sheet1 worksheet name.
NOTES
This tutorial explains and provides step by step instructions on how to delete multiple columns in a worksheet using Excel, VBA and Shortcut methods.
Excel Methods: Using Excel you can delete multiple columns by selecting entire columns, multiple cells and using a ribbon or cell option.
VBA Methods: Using VBA you can delete multiple columns by referencing to a multiple cells or entire columns.
Shortcut Methods: Using a Shortcut you can delete multiple columns by selecting entire columns where you want to delete columns and then actioning the shortcut.
ADDITIONAL NOTES
Note 1: Deleting columns will move the existing columns, that are to the right of the columns that you want to delete, leftwards. In this this tutorial every column to the right of column D will be moved to the left by three columns.
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 | |
Delete a column | How to delete 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 | |
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 |