PC Review


Reply
Thread Tools Rate Thread

Delete a filtered set

 
 
cmac
Guest
Posts: n/a
 
      6th Nov 2008
Hello,

As a part of a macro I would like to turn auto filters on and then find rows
of data that contain a zero in the 4th field. I would then like to delete
the rows contained in the results - however, the range may be different each
time the macro is run. is there a way to delete the results in general - can
you help?
 
Reply With Quote
 
 
 
 
Michael
Guest
Posts: n/a
 
      6th Nov 2008
Try this in Column A:

Sub FilterZeros()
Columns("A:A").AutoFilter
Range("A:A").AutoFilter Field:=1, Criteria1:="=0", Operator:=xlAnd
Range("A:A").SpecialCells(xlCellTypeVisible).EntireRow.Delete Shift:=xlUp

End SUb

--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"cmac" wrote:

> Hello,
>
> As a part of a macro I would like to turn auto filters on and then find rows
> of data that contain a zero in the 4th field. I would then like to delete
> the rows contained in the results - however, the range may be different each
> time the macro is run. is there a way to delete the results in general - can
> you help?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete all filtered rows from a macro? Joe M Microsoft Excel Programming 1 3rd Feb 2009 10:46 PM
Permanently delete filtered records =?Utf-8?B?QWxsZW4=?= Microsoft Excel Misc 12 8th Aug 2008 04:44 PM
Autofilter - delete filtered selection Albert Microsoft Excel Programming 12 2nd Feb 2008 11:53 AM
Delete the filtered records =?Utf-8?B?VkNLVw==?= Microsoft Excel Misc 4 15th Oct 2007 03:39 PM
Delete Filtered Rows Karen Microsoft Excel Misc 3 29th Apr 2004 11:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:34 PM.