Macro to Delete Blank Rows from row 3 onwards in Col B

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I have tried to write code to delete blank rows from Col 3 onwards, but no rows are being deleted

It would be appreciated if someone could assist me

Code:
 Sub Del_Blanks()

Dim LR As Long, I As Long
With Sheets("summary all tax types")

LR = .Range("A" & .Rows.Count).End(xlUp).Row
For I = LR To 2 Step -1

On Error Resume Next
Columns(I, 2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
Next I
 End With
 
End Sub
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
What column do you want to check for the blanks?
 
Upvote 0
Sorry i wat to Check Col B for Blanks
 
Upvote 0
Try this:
VBA Code:
Sub Del_Blanks()

    Dim LR As Long, I As Long

    With Sheets("summary all tax types")
        LR = .Range("A" & .Rows.Count).End(xlUp).Row
        For I = LR To 2 Step -1
            If .Cells(I, 2) = "" Then .Rows(I).Delete
        Next I
    End With
 
End Sub
 
Upvote 0
Solution
Many Thanks Joe. Your code works perfectly
 
Upvote 0
You are welcome.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top