Excel find a value delete rows until any valu [Closed]

Report
-
RayH
Posts
122
Registration date
Tuesday August 31, 2010
Status
Contributor
Last seen
June 20, 2016
-
Hi

Can any help me please? I am an Excel Macro virgin and this site seems brilliant!

I am trying to:

-find a value (PPA Pre-Checkpoint4) in a certain column (AX)
-delete the whole row that contains that value
-continue to delete rows until something is found in the column (AX) of any value
-continue to do the above until there are no more rows or subrows that belong to PPA Pre-Checpoint4

Please please help!

Thanks and regards

Tabe

3 replies

Posts
122
Registration date
Tuesday August 31, 2010
Status
Contributor
Last seen
June 20, 2016
24
Sub deleterow()
'
' Delete rows with Cell AX="PPA Pre-Checkpoint4"

Sheets("Sheet1").Select
Dim myrow As Integer
Let myrow = 1
While Cells(myrow, 50).Value <> ""  ' Loop until a blank cell is found

    If Cells(myrow, 50).Value = "PPA Pre-Checkpoint4" Then
        Cells(myrow, 50).Select
        Selection.Delete Shift:=xlUp
    
    Else
    Let myrow = myrow + 1
    End If
Wend

End Sub
2
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 3984 users have said thank you to us this month

Posts
122
Registration date
Tuesday August 31, 2010
Status
Contributor
Last seen
June 20, 2016
24
Sort the sheet by column AX. This will group all values in column AX together making them easy to find and delete.
Thank you for your help. I wanted a solution within a macro and I get these reports on a daily basis with hundereds of returned results. Therefore, doing it manually would take too long.