View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Patrick C. Simonds Patrick C. Simonds is offline
external usenet poster
 
Posts: 343
Default Filtering multiple sheets

Can any one tell me why the code below only seems to run on the active
worksheet? also is there any way to unfilter all 4 worksheets without
making them active?


Sub FilterData()
'
'
'
Application.ScreenUpdating = False

Module4.Disable_Events

With ActiveWorkbook.Worksheets("Relief Board")
Range("A6:K3000").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Range("A1:K2"), Unique:=False
Range("C6").Select
End With

With ActiveWorkbook.Worksheets("Fixed Route Operators")
Range("A6:K3000").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Range("A1:K2"), Unique:=False
Range("C6").Select
End With

With ActiveWorkbook.Worksheets("Paratransit Operators")
Range("A6:K3000").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Range("A1:K2"), Unique:=False
Range("C6").Select
End With

With ActiveWorkbook.Worksheets("Dispatchers, PSC's and CSR's")
Range("A6:K3000").AdvancedFilter Action:=xlFilterInPlace,
CriteriaRange:= _
Range("A1:K2"), Unique:=False
Range("C6").Select
End With


Module4.Enable_Events
Application.ScreenUpdating = True


End Sub