Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Apply same filter to all sheets in a workbook

Hi,

I am after a macro which filters by a particular name eg. Tyson in Column B
for all worksheets in a workbook.

I would be attaching this macro to a "macro" button so when the admin click
the button the sheets are filtered for Tyson. If they click another button
then the filter will apply to another name eg. ALI.

Please help with macro. I would record it but each month the sheet names and
number of sheets will vary.

Thanks,

Manir

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Apply same filter to all sheets in a workbook

Hi Manir,

How's this do you?

Sub Filter_All_Sheets()
Dim WS As Object
For Each WS In Worksheets
WS.Range("A1:C10").AutoFilter Field:=2, Criteria1:="Tyson"
Next WS
End Sub

Change the Range, Field (2 = column B) & Criteria to suit

JF

On 30 Jul, 16:23, manfareed
wrote:
Hi,

I am after a macro which filters by a particular name eg. Tyson *in Column B
for all worksheets in a workbook.

I would be attaching this macro to a "macro" button so when the admin click
the button the sheets are filtered for Tyson. If they click another button
then the filter will apply to another name eg. ALI.

Please help with macro. I would record it but each month the sheet names and
number of sheets will vary.

Thanks,

Manir


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Apply same filter to all sheets in a workbook

Should get you going.

Sub eachsht()
For i = 2 To Worksheets.Count
With Sheets(Sheets(i).Name)
MsgBox .Range("a1")
End With
Next i
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"manfareed" wrote in message
...
Hi,

I am after a macro which filters by a particular name eg. Tyson in Column
B
for all worksheets in a workbook.

I would be attaching this macro to a "macro" button so when the admin
click
the button the sheets are filtered for Tyson. If they click another button
then the filter will apply to another name eg. ALI.

Please help with macro. I would record it but each month the sheet names
and
number of sheets will vary.

Thanks,

Manir


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Apply same filter to all sheets in a workbook

Thanks JF ... just what I was after

" wrote:

Hi Manir,

How's this do you?

Sub Filter_All_Sheets()
Dim WS As Object
For Each WS In Worksheets
WS.Range("A1:C10").AutoFilter Field:=2, Criteria1:="Tyson"
Next WS
End Sub

Change the Range, Field (2 = column B) & Criteria to suit

JF

On 30 Jul, 16:23, manfareed
wrote:
Hi,

I am after a macro which filters by a particular name eg. Tyson in Column B
for all worksheets in a workbook.

I would be attaching this macro to a "macro" button so when the admin click
the button the sheets are filtered for Tyson. If they click another button
then the filter will apply to another name eg. ALI.

Please help with macro. I would record it but each month the sheet names and
number of sheets will vary.

Thanks,

Manir



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Apply same filter to all sheets in a workbook

Thanks Don ... I think I can use your code as well

"Don Guillett" wrote:

Should get you going.

Sub eachsht()
For i = 2 To Worksheets.Count
With Sheets(Sheets(i).Name)
MsgBox .Range("a1")
End With
Next i
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"manfareed" wrote in message
...
Hi,

I am after a macro which filters by a particular name eg. Tyson in Column
B
for all worksheets in a workbook.

I would be attaching this macro to a "macro" button so when the admin
click
the button the sheets are filtered for Tyson. If they click another button
then the filter will apply to another name eg. ALI.

Please help with macro. I would record it but each month the sheet names
and
number of sheets will vary.

Thanks,

Manir





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Apply same filter to all sheets in a workbook

Hi JF ,

How would I exclude the first worksheet. This is going to be a summary sheet
with macro button which the user will click to filter.

Thanks

" wrote:

Hi Manir,

How's this do you?

Sub Filter_All_Sheets()
Dim WS As Object
For Each WS In Worksheets
WS.Range("A1:C10").AutoFilter Field:=2, Criteria1:="Tyson"
Next WS
End Sub

Change the Range, Field (2 = column B) & Criteria to suit

JF

On 30 Jul, 16:23, manfareed
wrote:
Hi,

I am after a macro which filters by a particular name eg. Tyson in Column B
for all worksheets in a workbook.

I would be attaching this macro to a "macro" button so when the admin click
the button the sheets are filtered for Tyson. If they click another button
then the filter will apply to another name eg. ALI.

Please help with macro. I would record it but each month the sheet names and
number of sheets will vary.

Thanks,

Manir



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Apply same filter to all sheets in a workbook

Sub Filter_All_Booth()
Dim WS As Object

For Each WS In Worksheets
If WS.Name < "Summary" Then

WS.Range("A2:p50").AutoFilter Field:=2, Criteria1:="Booth"
end if
Next WS
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"manfareed" wrote in message
...
hi,

this is my final code but i get an error...run time error 91 ??

Sub Filter_All_Booth()
Dim WS As Object
If WS.Name < "Summary" Then

For Each WS In Worksheets
WS.Range("A2:p50").AutoFilter Field:=2, Criteria1:="Booth"
Next WS

End If

End Sub

thx


"Don Guillett" wrote:

if ws.name <"Summary" then

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"manfareed" wrote in message
...
Hi JF ,

How would I exclude the first worksheet. This is going to be a summary
sheet
with macro button which the user will click to filter.

Thanks

" wrote:

Hi Manir,

How's this do you?

Sub Filter_All_Sheets()
Dim WS As Object
For Each WS In Worksheets
WS.Range("A1:C10").AutoFilter Field:=2, Criteria1:="Tyson"
Next WS
End Sub

Change the Range, Field (2 = column B) & Criteria to suit

JF

On 30 Jul, 16:23, manfareed
wrote:
Hi,

I am after a macro which filters by a particular name eg. Tyson in
Column B
for all worksheets in a workbook.

I would be attaching this macro to a "macro" button so when the
admin
click
the button the sheets are filtered for Tyson. If they click another
button
then the filter will apply to another name eg. ALI.

Please help with macro. I would record it but each month the sheet
names and
number of sheets will vary.

Thanks,

Manir





  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Apply same filter to all sheets in a workbook

Many Thanks ...its been an education.

"Don Guillett" wrote:

Sub Filter_All_Booth()
Dim WS As Object

For Each WS In Worksheets
If WS.Name < "Summary" Then

WS.Range("A2:p50").AutoFilter Field:=2, Criteria1:="Booth"
end if
Next WS
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"manfareed" wrote in message
...
hi,

this is my final code but i get an error...run time error 91 ??

Sub Filter_All_Booth()
Dim WS As Object
If WS.Name < "Summary" Then

For Each WS In Worksheets
WS.Range("A2:p50").AutoFilter Field:=2, Criteria1:="Booth"
Next WS

End If

End Sub

thx


"Don Guillett" wrote:

if ws.name <"Summary" then

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"manfareed" wrote in message
...
Hi JF ,

How would I exclude the first worksheet. This is going to be a summary
sheet
with macro button which the user will click to filter.

Thanks

" wrote:

Hi Manir,

How's this do you?

Sub Filter_All_Sheets()
Dim WS As Object
For Each WS In Worksheets
WS.Range("A1:C10").AutoFilter Field:=2, Criteria1:="Tyson"
Next WS
End Sub

Change the Range, Field (2 = column B) & Criteria to suit

JF

On 30 Jul, 16:23, manfareed
wrote:
Hi,

I am after a macro which filters by a particular name eg. Tyson in
Column B
for all worksheets in a workbook.

I would be attaching this macro to a "macro" button so when the
admin
click
the button the sheets are filtered for Tyson. If they click another
button
then the filter will apply to another name eg. ALI.

Please help with macro. I would record it but each month the sheet
names and
number of sheets will vary.

Thanks,

Manir






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
Apply Conditional Format to all sheets in same workbook Der Musensohn Excel Discussion (Misc queries) 4 February 26th 10 04:24 PM
How do I get this Macro to apply to ALL sheets in workbook? Newsgal Excel Programming 2 August 2nd 07 09:43 PM
apply Macro to all sheets in workbook - loop [email protected] Excel Programming 3 July 19th 07 08:13 PM
how to apply the same header or footer to all sheets in workbook Luenda Burke Excel Worksheet Functions 1 November 1st 06 05:45 PM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork[_3_] Excel Programming 6 January 26th 06 06:31 PM


All times are GMT +1. The time now is 11:08 PM.

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"