Delete Blank Rows Using Excel VBA (Fast and Easy)

  • 0
  • 4333
Delete Blank Rows Using Excel VBA (Fast and Easy) © Delete Blank Rows Using Excel VBA (Fast and Easy)

Sometimes we export excel file that contain blank rows. If you try to delete these rows using filter and sort option they does not appears there. as you see in Image below:

blank row option in sort and filter excel

There are two ways to delete blank rows :

  1. Using VBA
  2. Without VBA

Using VBA:

Step 1:  Open Excel File that Contain Blank Rows.

Step 2: Press ALT + F11 to Open VBA Window.

Step 3: Go to Insert Menu and Click on Module.

vba insert menu module

Step 4: Now Copy and Paste This Code in Module

Sub Removerows()
  i = 0
  For i = 10 To 56
 If Worksheets(1).Cells(i, 1) = "" Then
  Worksheets(1).Cells(i, 1).Activate
     Rows(i).EntireRow.Delete   
    End If
    Next i
End Sub

vba insert menu module

Note: For i = 10 To 56 Means Table Data Starts From 10th Row and Ends on 56th Row. You can change this value as per your requirements. 

Step 5: Click on Run Button to run module and you see all blank rows has been deleted from active Sheet.

vba insert menu module

Video Tutorial (English):




Video Tutorial (Hindi):


Free Live TV and Movies in any Android TV
Prev Post Free Live TV and Movies in any Android TV
Delete Blank Rows in Excel (No-VBA)
Next Post Delete Blank Rows in Excel (No-VBA)
Commnets 0
Leave A Comment