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 wor
Just tell it to ignore the sheet by checking each sheet name:
Sub doit()
Application.DisplayAlerts = False
Dim r As Long, lr As Long
Dim sh As Worksheet
For Each sh In Sheets
If sh.Name <> "IgnoreThisSheet" Then
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
End If
Next
Application.DisplayAlerts = True
End Sub
Edit: You may also want to change Sheets to WorkSheets in your For Each loop. A worksheet contains rows, columns, etc. A sheet can be a chart sheet, macro sheet or dialog sheet. http://blogs.msdn.com/b/frice/archive/2007/12/05/excel-s-worksheets-and-sheets-collection-what-s-the-difference.aspx
If the sheet name is always going to be the same then you could use this ..
If sh.Name <> "Sheet 1" Then ' Or whatever the sheet is called
.. more code
End If