C
Craig
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
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