I was working with a vba code which remove all the rows which dont have word "Statement No" in it from all available worksheets. But anyhow i want it to skip the first worksheet and continue removing the rows from all other worksheets.
If you can help me with the below code so that it skips the first worksheet.
Sub doit()
Application.DisplayAlerts = False
Dim r As Long, lr As Long
Dim sh As Worksheet
For Each sh In Sheets
lr = sh.Cells(sh.Rows.Count, 1).End(xlUp).row
For r = lr To 1 Step -1
If InStr(sh.Cells(r, 1), "Statement No") = 0 Then sh.Rows(r).Delete
Next r
Next
Application.DisplayAlerts = True
End Sub
Thank you All!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…