How to Delete All Rows Below a Certain Row in Excel?

If you are looking for some of the easiest ways to delete all rows below a certain row in Excel, then you are in the right place. By following this article, you will be able to learn 6 easy ways to delete all rows below a certain row easily and effectively rather than doing it manually in Excel.

In the following image, we have used the delete sheet rows option to erase rows below a certain one in Excel.

Delete Sheet Rows Option for Deleting All Rows Below a Certain Row


How to Delete All Rows Below a Certain Row in Excel: 6 Easy Ways

Here, I have used the following data table of “XYZ Company” with which I will explain the easiest methods to delete all rows below a certain row in Excel. However, it contains the details of some products. For this purpose, I have used Microsoft Excel 365 version, you can use any other version according to your convenience.

Excel Delete All Rows Below a Certain Row Dataset


Method-1: Use of Delete Option in Context Menu to Delete Rows

Let’s say, you want to delete the last three rows which means Row 11 to Row 13  for Pant as a product. You can select the rows and delete them from the Context menu. Hence, follow the steps below.

Steps:

  • Select the Cell B11.
  • Press CTRL+SHIFT++.
  • Then, all of the cells of the last three rows will be selected.

Use of Delete Option to Delete All Rows Below a Certain Row

  • After that, right-click and select the Delete option from the Context Menu.

Delete option in excel

  • Now, select Entire row and press OK.

delete dialog box

  • Finally, all of the unwanted rows below a certain will be deleted.

delete row output


Method-2: Delete Sheet Rows Option to Delete Rows Below a Certain Row

Additionally, if you want to delete the rows below the row for Jacket 3 then you can do it just with the Delete Sheet Rows option. Hence, follow the steps below.

Steps:

  • Similarly, select the 3 rows with the help of the mouse.
  • Then, go to the Home Tab.
  • Next, from the Cells dropdown, select Delete dropdown.
  • Afterwards, click on the Delete Sheet Rows option.

Delete Sheet Rows Option for Deleting All Rows Below a Certain Row

  • Finally, you will be able to remove the rows below a certain row for Jacket 3.

Delete Sheet Rows Option Final Output


Method-3: Utilize Name Box in Excel to Delete Rows

Furthermore, you can use the Name Box to delete all of the rows below a certain row like a row for Jacket 3. Hence, follow the steps below.

Steps:

  • Select the Name Box area.
  • Type the range of rows you want to delete. In this case, the range is 11:13.

Using Name Box to Delete All Rows Below a Certain Row

  • After that, you will be able to select the undesired rows automatically.
  • Follow the second step of Method-1 or Method-2.
  • Finally, you will be able to delete all of the rows below the row for Jacket 3.

Use of name box in excel


Method-4: Apply Excel VBA Code to Remove Rows

However, you can use VBA to delete rows below a certain row here I will delete the last three rows. Hence, follow the steps below.

Steps:

  • Go to Developer Tab>>Visual Basic Option.
  • Then, Visual Basic Editor will open up.
  • Go to Insert Tab>>Module Option.
  • After that, Module 1 will be created.

Using VBA Code to Delete All Rows below a Certain Row

  • Now, Write the following code here.
Sub RemoveRowsBelow()
'delete all rows below certain row
Worksheets("VBA").Rows(11 & ":" & Worksheets("VBA").Rows.Count).Delete
End Sub

VBA code to Delete All Rows Below a Certain Row

  • Here, VBA is the sheet name and 11 refers to from which row you want to delete the rest of the rows.
  • Press F5.
  • Then, you will get the following table where you will be able to remove the undesired rows.

VBA output to delete rows


Method-5: Delete All Rows Below the Last Active Row by Keyboard Shortcuts

Using keyboard shortcuts to delete rows is another way for you.

For instance, you want to delete all of the empty rows below the data table. You can do it by hiding the empty rows easily. Hence, follow the steps below.

Steps:

  • Select the cell from where you want to remove the rows.

Deleting All Rows below the Last Active Row in Excel

  • Press CTRL+SHIFT+.
  • Press CTRL+SHIFT+.

Use of keyboard shortcuts to select rows

  • In this way, all of the unused cells will be selected.
  • Right-click on your mouse.
  • Select Hide Option.

hide option from context menu

  • Lastly, you will be able to hide all of the rows below the data table as follows.

Deleting All Rows below the Last Active Row Output


Method-6: Remove Rows Below the Last Active Row with Excel VBA

Lastly, if you want to delete the rows below the last active row including the active row you can use a VBA code. Let’s say, here our last active row is the row for Pant 1 and we will remove the following rows including this active row. Hence, follow the steps below.

Steps:

  • Follow Step-01 of Method-4.
  • Now, write the following code.
Sub Rmvall()
    Rows(ActiveCell.Row & ":" & Rows.Count).Delete
End Sub

Deleting All Rows below the Last Active Row with a VBA Code

  • Here, ActiveCell.Row will return the row number of active rows and Rows.Count will count the rows in Excel and return the bottom-most row number and these two numbers will be the range for ROWS.
  • After that, select the row from where you want to delete rows.

Use of vba to in excel

  • Go to the Macros Option.
  • Now, select  Rmvall as the Macro name (the name used for the VBA code).
  • Press Run.

vba dialog box

  • Lastly, you will get the following result.

VBA Code Output to Delete rows


Download Workbook


Conclusion

In this article, I tried to cover the easiest ways to delete all rows below a certain row effectively. Hope you will find it useful. If you have any suggestions or questions feel free to share them with us.


You May Also Like to Read


<< Go Back to Delete Rows | Rows in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Tanjima Hossain
Tanjima Hossain

TANJIMA HOSSAIN is a marine engineer who enjoys working with Excel and VBA programming. For her, programming is a handy, time-saving tool for managing data, files, and online tasks. She's skilled in Rhino3D, Maxsurf C++, MS Office, AutoCAD, and Excel & VBA, going beyond the basics. She holds a B.Sc. in Naval Architecture & Marine Engineering from BUET and is now a content developer. In this role, she creates tech-focused content centred around Excel and VBA. Apart from... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo