Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Delete a filtered set

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Delete a filtered set

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).Entir eRow.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
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
Permanently delete filtered records Allen Excel Discussion (Misc queries) 12 August 8th 08 04:44 PM
Autofilter - delete filtered selection Albert Excel Programming 12 February 2nd 08 11:53 AM
Delete the filtered records VCKW Excel Discussion (Misc queries) 4 October 15th 07 03:39 PM
Delete Rows Filtered within Auto Filter Gordon[_2_] Excel Programming 1 September 30th 06 10:38 AM
Excel - How do I delete filtered out rows? rook Excel Discussion (Misc queries) 2 November 30th 05 10:45 PM


All times are GMT +1. The time now is 05:48 PM.

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

About Us

"It's about Microsoft Excel"