I am trying to delete rows in a spreadsheet which have 'other - rubbish bin' in column S. Whenever I use the following scrpit, it deletes the heading row (row A). How can I get round this and is there a better way to get rid of all rows with this criteria in?
Sub breaktest()
'
' breaktest Macro
' Macro recorded 12/10/2006 by John Royle
Dim lastrow As Long
Sheets("BREAKS>$1m").Select
Selection.AutoFilter field:=19, Criteria1:="other - rubbish bin"
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter field:=19
Rows("2:21575").Select
End Sub
Sub breaktest()
'
' breaktest Macro
' Macro recorded 12/10/2006 by John Royle
Dim lastrow As Long
Sheets("BREAKS>$1m").Select
Selection.AutoFilter field:=19, Criteria1:="other - rubbish bin"
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter field:=19
Rows("2:21575").Select
End Sub