Forum

"Reapply All" filte...
 
Notifications
Clear all

"Reapply All" filter (Filter) in all worksheets in VBA.

2 Posts
2 Users
0 Reactions
230 Views
(@milebettu21)
Posts: 1
New Member
Topic starter
 

Good moorning,
I have 4 worksheets:

Sheet1
Sheet2
Sheet3
Sheet4

I would like to know if there is a VBA macro when opening the file, does the "Reapply All" filter (Filter) in all worksheets work?

Thanks for your help.

 
Posted : 29/11/2021 11:09 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi Mile,

Depends on what you have in that sheet. If you have pivot tables, you have to use a method specific to them, same for tables.

If you don't have these objects, try this code in ThisWorkbook module:

Sub Workbook_Open()

Dim Wks as worksheet

For each Wks in ThisWorkbook.Worksheets
If (wks.AutoFilterMode And wks.FilterMode) Or wks.FilterMode Then wks.ShowAllData
Next Wks

Ed Sub

The code will loop through all sheets.

 
Posted : 02/12/2021 3:20 am
Share: