View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
external usenet poster
 
Posts: 1,522
Default Apply macro to all worksheets

On Jun 22, 8:28*am, "Cimjet" wrote:
Hi Everyone
This macro works ok on the open worksheet. I would like to filter all worksheets
in the workbook
Sub Filter()
* * * * For Each wks In Selection
* * Selection.AutoFilter Field:=2, Criteria1:="" & DateSerial(2011, 4, 1),
Operator:=xlAnd, _
* * * * Criteria2:="<" & DateSerial(2011, 4, 30)
* * * * * * * * * *Next wks
* * *End Sub


for each wks in worksheets
ws.autofilter