Windows XP Getting a Macro to run in multiple sheets

Joined
Sep 12, 2009
Messages
1
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top