LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Autofilter & delete lines

I have recorded a macro which autofilters data and then deletes the lines
selected. The autofilter criteria are hard coded into the macro (e.g filter
all items with description "Interim"). My problem is where there is no data
with the the hard coded description in the particular batch of information I
am running the macro on.

Selection.AutoFilter Field:=45, Criteria1:="Interim"
Range("AS3").Select ' This is the heading row in the column
being filtered
ActiveCell.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.EntireRow.Delete

How do I get the macro to skip lines 2 to 6 above if there is no data with a
description of Interim and to move onto the next hard coded description?

Thanks in advance

Craig


 
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
Delete options for AutoFilter? Jojjjo Excel Worksheet Functions 2 March 31st 08 07:19 AM
how to display the count of lines found by autofilter? elaineb Excel Discussion (Misc queries) 1 April 6th 05 07:08 PM
delete rows autofilter masterphilch Excel Programming 3 January 5th 05 08:07 PM
Delete results of Autofilter??? Kobayashi[_31_] Excel Programming 4 February 18th 04 05:37 PM
Removing Lines Identified by Autofilter Neil[_6_] Excel Programming 2 July 10th 03 04:58 AM


All times are GMT +1. The time now is 12:21 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"