View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jc jc is offline
external usenet poster
 
Posts: 164
Default Macro to delete with filters

I am VERY new to macros...In fact, this is only my second macro. I have a
macro that i pieced together that will delete any line that has a "$0.00" in
column AP or a "NoCH" or "PrOK" in column O...however, i can't get it to
work...i've pasted it below...can you please tell me where i've gone wrong?
I get the "Debug" message...


Sub Filter_to_zero()
'
' Filter_to_zero Macro
' Macro recorded 1/10/2008 by Justin Christensen (ZJC0329 - CFS-L3E9621)
'

Selection.AutoFilter Field:=42, Criteria1:="$0.00 "
Rows("12:3500").Select
Range("AP12").Activate
Selection.EntireRow.Delete
ActiveSheet.ShowAllData
Range("AP12").Select

Selection.AutoFilter Field:=15, Criteria1:="PrOK"
Rows("12:1500").Select
Range("O12").Activate
Selection.EntireRow.Delete
ActiveSheet.ShowAllData
Range("O12").Select

Selection.AutoFilter Field:=15, Criteria1:="NoCh"
Rows("12:1500").Select
Range("O12").Activate
Selection.EntireRow.Delete
ActiveSheet.ShowAllData
Range("A12").Select
End Sub

Thanks!!
~JC