View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Ben McClave Ben McClave is offline
external usenet poster
 
Posts: 173
Default filter that yeilds no results

Matthew,

I'm glad you found a workaround. Just in case you try the code I posted and it bugs out at the delete line, you can try this modification instead:

Dim lRow As Long
Set myrange = Range("A1:" & ConvertToCol(LastCol(ActiveSheet)) & lastrow(ActiveSheet))
myrange.AutoFilter
myrange.AutoFilter Field:=12, Criteria1:="=0", _
Operator:=xlOr, Criteria2:="=2E"
lRow = WorksheetFunction.Max(2, lastrow(ActiveSheet) + 1)
If lrow 1 Then _
Range("A2:aq" & lRow).SpecialCells(xlCellTypeVisible).Delete
myrange.AutoFilter