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