Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50057

advanced filter - button to re apply advanced filter across multiple sheets

$
0
0
Hi,

Firstly I am new both to macros and the forum, so apologies if this is simple/somewhere else - I have looked for over 3 hours and had no luck so here goes...

I am working across multiple worksheets - each work sheet has one table ie "South" and "North" - each table has an advanced filter, filtered with the same criteria (this is on a separate worksheet) - I would like to refresh the advanced filters applicable to the relevant tables by clicking a button (form control).

There are other tables in the work book which I need left unfiltered.

I have been able to achieve this duplicating the code below and changing the table name ie from "South" to "North", however I was wondering if there was a neater way of doing it? I maintain a list of the table names in the work book and thought I may be able to use this somehow...


Code:

    Range("South[#All]").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange _
        :=Range("hide_all_zeros"), Unique:=False
       
    Range("North[#All]").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange _
        :=Range("hide_all_zeros"), Unique:=False

Please let me know your thoughts.

Many Thanks,
Tom.

Viewing all articles
Browse latest Browse all 50057

Trending Articles