I want to filter a range on all sheets in a workbook, but it's possible that additional sheets would be added later. I tried adding in an absurd amount of sheets to loop through, but I don't want the error popping up at the end. I would like either to End Sub on error or have a slick way of looping where it ends with the last sheet.
Thanks a bunch for your help!
Chris
Code
Sub FilterAll()
'
' FilterAll Macro
' Macro recorded 3/10/2004 by Chris Lynn
'
'
RLetter = InputBox("Enter Column to Filter", "Filter Column", RLetter, 2, 1)
For x = 1 To 300
Range(RLetter & "20:" & RLetter & "200").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=">1", Operator:=xlAnd
Range("a1").Select
ActiveSheet.Next.Select
'On Error GoTo <--- How to end is the question
Next
End Sub
Display More