Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


 How to apply same filter to multiple sheets In Excel?

It may be easy for us to apply the Filter function to filter data in a worksheet, but, sometimes, you may need to filter across multiple worksheets which have common data formatting with the same filter criteria. To filter them one by one will waste lots of time, here, I can introduce an easy way to solve it at once.

Apply same filter to multiple worksheets with VBA code

Filter data by multiple criteria or other specific condition, such as by text length, by case sensitive, etc.

Kutools for Excel’s Super Filter feature is a powerful utility, you can apply this feature to finish the following operations:

  • Filter data with multiple criteria;              Filter data by text length;
  • Filter data by upper / lower case;             Filter date by year / month / Day / week / quarter


Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!

arrow blue right bubble Apply same filter to multiple worksheets with VBA code

For example, I have four worksheets as following screenshot need to be filtered with the same criteria that the Product = KTE at once.

doc filter multiple sheets 1

There is no direct way to filter data in multiple sheets in Excel, but, the following VBA code can help you to finish this job, please do as follows:

1. Hold down the ALT + F11 keys, then it opens the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Apply same filter to multiple worksheets:

Sub apply_autofilter_across_worksheets()
'Updateby Extendoffice 20160623
    Dim xWs As Worksheet
    On Error Resume Next
    For Each xWs In Worksheets
        xWs.Range("A1").AutoFilter 1, "=KTE"
End Sub

3. And then press F5 key to run this code, all products of KTE have been filtered in all worksheets at once, see screenshot:

doc filter multiple sheets 2

Note: Within above code, in this xWs.Range("A1").AutoFilter 1, "=KTE" script, A1 and =KTE indicates the column and criteria which you want to filter based on, the number 1 is the column number you filtered based on, you can change them to your need. For example, if you want to filter the order greater than 50, you just need to modify this script as this: xWs.Range("B1").AutoFilter 2, ">50".

Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    berenice · 1 months ago
    how to eliminate filtered rows?
  • To post as a guest, your comment is unpublished.
    Sibi · 7 months ago
    How to use "Filter Between" Function, for the same multiple sheets?

    (Example: Time range)
  • To post as a guest, your comment is unpublished.
    Suyash · 7 months ago
    Can we use cell name like Product instead of A1 in : xWs.Range("A1").AutoFilter 1, "=KTE"
    I have different column and some names comes in different column.
    • To post as a guest, your comment is unpublished.
      Suyash · 7 months ago
      I have used filter in every sheet. And I want to change s.no from 1 2 3 serially in every sheet after filter.

      Please let me know if you have vba code for it
  • To post as a guest, your comment is unpublished.
    jarred · 9 months ago
    HI, does the super filter across the entire workbook automatically reapply whenever theres an update of the file?
  • To post as a guest, your comment is unpublished.
    Sebastian · 1 years ago
    Thank you for the code!! is there a way to change the "=KTE" to use a value from a List or Drop down list?