Delete Row If Column A=""

Xirrus1983

New Member
Joined
Nov 11, 2008
Messages
37
I need a macro that will delete an entire row if column A="" from a formula.

It needs to start at A15 down. Thank you if anyone can assist me.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Try this:

Code:
Sub delrows()
Dim l As Long

l = Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row

For l = l To 15 Step -1
If Sheets("Sheet1").Cells(l, 1) = "" Then
Cells(l, 1).EntireRow.Delete
End If
Next l
End Sub
 
Upvote 0
Hi

This applies to all the sheets in your current workbook. Checks if any row in column A is blank from A15 and deletes the entire row. It performs for all the sheets in your workbook.

Code:
Sub delrows()
Dim l As Long
Dim i As Integer
i = ThisWorkbook.Worksheets.Count
For i = 1 To i
l = Sheets(i).Range("A" & Rows.Count).End(xlUp).Row
    For l = l To 15 Step -1
    If Sheets(i).Cells(l, 1) = "" Then
    Sheets(i).Cells(l, 1).EntireRow.Delete
    End If
    Next l
Next i
End Sub
Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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