How to Always Insert a Blank Row Below Instead of Above in Excel?


If you have ever tried to insert a row in Excel by clicking on the insert button, you can see that the new row will always be inserted below and above the existing cell, but when we want to insert the cell below instead of above, it will not be possible in Excel. This tutorial will explain how to always insert a black row instead of above in Excel using VBA code.

Always Insert a Blank Row Below Instead of Above

Here we will insert the VBA module and then run it to complete our task. Let's go over a simple procedure for inserting a blank row below instead of above in Excel.

Step 1

Let us consider an Excel sheet where the data is similar to the data shown in the below image.

Now, when we try to insert the row directly, the row is always inserted above the selected cell.

Step 2

To insert the row below, right-click on the sheet name and select view code to open the VB code, then insert, select insert module, and enter the programme in the text box, as shown in the image below.

Program

Sub InsertRowDown()
'Updateby Nirmal
Dim xRg As Range
   On Error Resume Next
   Application.ScreenUpdating = False
   Set xRg = ActiveCell.Offset(1, 0)
   xRg.EntireRow.Select
   Selection.Insert Shift:=xlDown
   Selection.ClearFormats
   Application.ScreenUpdating = True
End Sub

Now save the module and close the vba with the Alt + Q command.

Step 3

Now click on "Insert" and "Illustrations," and draw a rectangle and write something on it on the sheet as shown in the below image.

Step 4

Now, right-click on the box and choose Assign Macro from the menu box; a new pop-up window will appear, as shown below.

Now, in the macro name, select Insert Row Down and click on OK to create a button to insert a new row below.

To insert a new row, click on a cell and click on the box to insert the rows below.

Conclusion

In this tutorial, we used a simple example to demonstrate how we can always insert a row below instead of above in Excel to highlight a particular set of data.

Updated on: 09-Jan-2023

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements