write at exceltoexplore@gmail.com : Report Automation|Dashboard in Excel| Provide Excel consulting through macro (VBA) automation |Financial Modeling | Ethical Hacking

Wednesday, 10 August 2011

Delete Rows contain Zero

Try :

Sub Mtest()
Dim LR As Long, r As Long
LR = ActiveSheet.UsedRange.Row + ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = LR To 1 Step -1
If Application.WorksheetFunction.CountIf(Rows(r), "=0") = 1 Then Rows(r).Delete
Next r
Application.ScreenUpdating = True
End Sub

No comments:

Post a Comment