LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AFTER I SORT AND FILTER A WORKSHEET CAN I DELETE THE FILTERS Angela Excel Worksheet Functions 1 January 26th 10 06:08 PM
Excel 2003 - Delete lists and/or filters from of range cells. Champ Excel Discussion (Misc queries) 2 December 18th 09 12:43 PM
Remove or delete lists/filters. Champ Excel Discussion (Misc queries) 1 December 10th 09 12:35 PM
ADVANCED FILTERS WITH MACRO Mysore Excel Discussion (Misc queries) 0 September 26th 07 11:03 PM
Filters, Subtotal & Intacted Results after the filters' Removal kasiopi Excel Discussion (Misc queries) 5 February 24th 06 12:18 PM


All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"