Excel find a value delete rows until any valu

Closed
Tabe - Oct 28, 2010 at 09:46 AM
RayH Posts 122 Registration date Tuesday August 31, 2010 Status Contributor Last seen June 20, 2016 - Oct 31, 2010 at 06:18 PM
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 responses

RayH Posts 122 Registration date Tuesday August 31, 2010 Status Contributor Last seen June 20, 2016 26
Oct 31, 2010 at 06:18 PM
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
RayH Posts 122 Registration date Tuesday August 31, 2010 Status Contributor Last seen June 20, 2016 26
Oct 28, 2010 at 10:19 AM
Sort the sheet by column AX. This will group all values in column AX together making them easy to find and delete.
0
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.
0