-
Solved: Delete Rows That Total 0
I have a need to automatically delete rows where a total amount in column p = zero. This would apply to all rows in the spreadsheet starting with row 3 and continuing to the end of the spreadsheet. This spreadsheet may have as many 10,000 rows. I attached an example spreadsheet. Could you help me with the code to do this?
Thanks
-
[VBA]
Sub DelRowsPEq0()
'
Application.ScreenUpdating = False
Range("P4").AutoFilter
With Range("p4").CurrentRegion
.AutoFilter Field:=14, Criteria1:="0"
End With
Range("a4", Range("a4").SpecialCells(xlLastCell)).SpecialCells(xlCellTypeVisible).Entir eRow.Delete
Range("A4").AutoFilter
Application.ScreenUpdating = True
End Sub[/VBA]
-
This works great! Thanks for the quick reply and great help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules