Filter multiple sheets based on one value

CHRISTACKLEBERRY

New Member
Joined
Jul 30, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have seen similar questions and answers, but I have not been able to replicate the results in my situation. (possibly due to a table vs range)

I have an excel file with multiple sheets. I need to filter 3 of the sheets based on the value I type in cell A1 of SHEET1
Lets call the 3 sheets "BILL", "FRANK", and "PETE"
FRANK and PETE are just ranges with data that gets pasted in daily. BILL is a table that has to be refreshed daily.

The column names I need filtered in all 3 sheets are all called "F#" but are not in the same location on each sheet (column 1, 2, 3, etc.)

Can anyone provide some guidance?

Thanks in advance!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Assuming the headers are in row 1, try:
VBA Code:
Sub FilterSheets()
    Application.ScreenUpdating = False
    Dim fnd As Range, ws As Worksheet
    For Each ws In Sheets(Array("BILL", "FRANK", "PETE"))
        Set fnd = ws.Rows(1).Find("F#", LookIn:=xlValues, lookat:=xlWhole)
        If Not fnd Is Nothing Then
            ws.Range("A1").AutoFilter fnd.Column, Sheets("Sheet1").Range("A1").Value
        End If
    Next ws
    Application.ScreenUpdating = True
End Sub
 
Upvote 1
Solution
YES YES YES!!! :biggrin:
Thank you so much! I was able to use the code you provided and add a button to the file so my team can filter all sheets at once.

And your code is written in a way that I can easily modify it apply to other files.
 
Upvote 0

Forum statistics

Threads
1,215,180
Messages
6,123,504
Members
449,101
Latest member
mgro123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top