Thread: advanced filter
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
SteveDB1 SteveDB1 is offline
external usenet poster
 
Posts: 414
Default advanced filter

3. If you want to pick a filter on one page and have it filter two pages you
will need to consider VBA. Do you want a programming solution?


Shane,
I've decided to try to record a macro that does the basics of what I'm
looking for, and this is the code that it created.

Sub FilterB()
'
' FilterB Macro
'

'
Selection.AutoFilter
Range("A8:F8").Select 'my range varies from file to file.
Selection.AutoFilter
Sheets("Pg 5_09-29-2008").Select 'the sheet name is always Pg5, but the
date 'will always vary.
Selection.AutoFilter
ActiveSheet.Range("$A$3:$J$29").AutoFilter Field:=6, Criteria1:="<"
' my range will always vary. Field 6 is constant, I'm not clear why it only
'shows "<" for my criteria.
Sheets("Sum").Select 'this worksheet has some variation on Sum, SUM,
'Summary, etc....
ActiveSheet.Range("$A$8:$F$13").AutoFilter Field:=1, Criteria1:="<"

End Sub


In looking at the elements, I want to connect the filter operation between
two worksheets.

I.e., Pg5_Date is my primary sheet. Sum is my secondary sheet.
My goal is to perform the same filter on the Sum sheet as I do on Pg5_Date,
automatically.

This is to reduce the time that I spend doing the filter on each sheet--
going back and forth for specific criteria in fields 1 and 6.
So that if I set my field 6 criteria on page 5, it will automatically set my
field 1 criteria on Sum.
There are some files that have well over 500 rows of data for Pg5 sheets.

Going back and forth between the two worksheets is taking way to long, and I
want to shorten the process-- by what seems a feasible process of "linking"
the two filters into a single operation.

So, my question is:

How can I make the filter on Pg5 activate and match the filter operation on
Sum?

Thank you.
SteveB.