Hi Everyone,
I am working on a project and have copied the macro below to delete lines which contain "0" in the 8th column.
It seems to work well, but I need to get it to run across 6 sheets in the same workbook.
Can someone show me how to do this?
Thanks for your help.
Sub Delete_0_MarkedRows()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim lastrow As Long, r As Long
lastrow = ActiveSheet.UsedRange.Rows.Count
For r = lastrow To 1 Step -1
If UCase(Cells(r, 8).Value) = "0" Then Rows(r).Delete
Next r
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
I am working on a project and have copied the macro below to delete lines which contain "0" in the 8th column.
It seems to work well, but I need to get it to run across 6 sheets in the same workbook.
Can someone show me how to do this?
Thanks for your help.
Sub Delete_0_MarkedRows()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim lastrow As Long, r As Long
lastrow = ActiveSheet.UsedRange.Rows.Count
For r = lastrow To 1 Step -1
If UCase(Cells(r, 8).Value) = "0" Then Rows(r).Delete
Next r
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub