How can i make this code run every sheet that is on the workbook ?
Code:
Sub AAP()
ChDir "C:\Documents and Settings\aoz\Desktop\cap rep\1\"
Workbooks.Open Filename:= _
"C:\Documents and Settings\aoz\Desktop\cap rep\1\TK_LO_CAP_REP.xls"
With ActiveSheet
.Range(Selection, ActiveCell.SpecialCells(xlLastCell)).AutoFilter Field:=1, Criteria1:=Array( _
"AYT", "DGT", "DHA", "DHQ", "DLB", "DLD", "DLI", "ETF", "FAA", "GBB", "IMT", "TIE", "TIP", _
"YSE", "YSM", "YSP", "MAA", "YSA"), Operator:=xlFilterValues
.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.Range("$A$3:$AG$10000").AutoFilter Field:=1
End With
ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\aoz\Desktop\cap rep\1\" & "AAP_TK_LO_CAP_REP.xls (" & Format(Date, "dd-mm-yyyy") & ").xls" _
, FileFormat:=xlExcel8, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
End Sub