Help with find if value is present then delete entrie row

antthorne

Board Regular
Joined
Feb 18, 2010
Messages
151
Hi

Wondered if someone can help

I've got the following code

Code:
If Sheets("Data").Range("u11").Value > 1 Then
    Sheets("Swansea").Select
Last17 = Cells(Rows.Count, "D").End(xlUp).Row
    For i = Last17 To 1 Step -1
        If (Cells(i, "b").Value) = "PO" Then
            Cells(i, "A").EntireRow.Delete
        End If
    Next i
End If

It basically goes through Sheet Swansea and if it finds PO in Column B it deletes the Entire Row. This works fine, but my title row (Row 3) has PO in it so it deletes this row too. Is there a way to stop the next I at row 4?

Thanks in advance
Anthony
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Ahh yes. Look like I replied too fast without enough reading, but you got the gist. Glad you got it taken care of.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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