View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
duncanidaho duncanidaho is offline
external usenet poster
 
Posts: 1
Default Filter all worksheets in workbook

I have a workbook with 100 sheets in it. I have a macro that goes
through each sheet and call
a procedure that filters a specific column. The macro works fine, but I
like to know if any one knows a faster and more efficent way to do the
same macro. Maybe without using a Select method. Here is a sample of
my macro:

Sheets("1").Select
Selection.AutoFilter Field:=3, Criteria1:="=1", Operator:=xlAnd
Call filtercopy
Selection.AutoFilter Field:=3
Sheets("2").Select
Selection.AutoFilter Field:=3, Criteria1:="=1", Operator:=xlAnd
Call filtercopy
Selection.AutoFilter Field:=3
Sheets("3").Select
Selection.AutoFilter Field:=3, Criteria1:="=1", Operator:=xlAnd
Call filtercopy

And the Call Filtercopy procedure is as follows:


Selection.copy
Windows("filterresults.xls").activate
Cells(Rows.Count, "a").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Windows("results.xls").activate


Thank you for any help.