Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Macro For Filtering on Multiple Sheets

Hi Jason,

Maybe this will get you started. I don't work with auto
filters a lot, but I found something that worked, with a
little experimentation. You can modify this to suit.
Also check the internet for more.

Note this works only with some conditions. It fails if
the criteria is (all) or (top10) etc. And it fails in
other cases too with other combinations. I think there's
a lot more work that has to be done with this....

Sub FourSheetAutoFilters()
Dim S1 As Worksheet: Dim S2 As Worksheet
Dim S3 As Worksheet: Dim S4 As Worksheet
Set S1 = Sheets(1): Set S2 = Sheets(2)
Set S3 = Sheets(3): Set S4 = Sheets(4)

If S1.AutoFilter.Filters(1).Criteria1 = "=Bill" Then
S2.Range("A1").AutoFilter Field:=1, Criteria1:="Bill"
S3.Range("A1").AutoFilter Field:=1, Criteria1:="Bill"
S4.Range("A1").AutoFilter Field:=1, Criteria1:="Bill"
Else
MsgBox "Not Bill"
End If
End Sub

If I find out more and better solutions, I'll let you
know. Meanwhile, let us know how you're doing with this.
Maybe you've figured it out and can share it with us. :)

Rick

-----Original Message-----
Hi,

I have a workbook that has four sheets that contain the
exact same formats (i.e. column headings, range areas,
etc.). The sheets do cover different time periods and
thus the data in each sheet is unique. Currently I have
filters applied on each sheet. Could anyone help me with
a macro that would allow the filtering criteria which is
selected in the first sheet to automatically apply to not
only the first sheet, but also each of the other sheets
as well. Therefore, I would be controlling the filtering
criteria for all four sheets from the criteria selected
on the first sheet. Any suggestions greatly
appreciated. Thanks.

Jason
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for summarizing multiple sheets Validlyte Excel Worksheet Functions 1 February 19th 10 07:33 PM
Filtering of data in a master excel sheet from multiple sheets Khawajaanwar Excel Discussion (Misc queries) 3 January 25th 10 05:22 PM
Check Box Macro for multiple sheets Kbernbr New Users to Excel 1 August 26th 08 01:23 AM
Macro to protect multiple sheets? Stilla Excel Worksheet Functions 12 March 5th 07 07:03 PM
Filtering for multiple sheets JVDM Excel Discussion (Misc queries) 1 October 11th 05 10:50 PM


All times are GMT +1. The time now is 07:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"