View Single Post
 
Old 04-28-2019, 02:30 AM
MagPower MagPower is offline Windows 10 Office 2019
Novice
 
Join Date: Feb 2019
Posts: 1
MagPower is on a distinguished road
Default

Quote:
Originally Posted by Alansidman View Post
Maybe this:
Code:
Option Explicit

Sub ChrisOK()
    Dim i As Long, lr As Long
    lr = Range("A" & Rows.Count).End(xlUp).Row
    Application.ScreenUpdating = False
    For i = lr To 1 Step -1
        If Range("C" & i) = "" Then
            Range("C" & i).EntireRow.Delete
        ElseIf Range("D" & i) = "#VALUE" Then
            Range("D" & i).EntireRow.Delete
        End If
    Next i
    Application.ScreenUpdating = True
    MsgBox ("Complete")
End Sub

I would use Alan's code, but with one modification of the first "If" statement:

If Range("C" & i) = "" And Range("A" & i) <> "" Then
Reply With Quote