Automatically Refresh an "AutoFilter"

pyronaya

New Member
Joined
Apr 18, 2006
Messages
7
Hello,

I have a workbook that has different product lines on separtate worksheets. Also there is one summary worksheet that contains an "AutoFilter".

Is there a way to have that Summary worksheet "Refresh" its AutoFilter whenever it is opened?

Thanks!!
 

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
Hi,

You could use a Worksheet_Activate event like this:

Code:
Private Sub worksheet_activate()

Range("A1").CurrentRegion.Select

Selection.AutoFilter Field:=3, Criteria1:="Andrews"

Range("A1").Select

End Sub

In this example surnames are listed in column C and the filter applies to show only individuals called Andrews.

The code should be placed on the worksheets module. To open this right click on the worksheet tab and past the code in the resulting window.

It won't work if people don't enable macros when opening the document though.

Hope it helps.
 

pyronaya

New Member
Joined
Apr 18, 2006
Messages
7
AWESOME!!!

Thanks Domski....I really need to buy a VBA Macro book from Mr. Excel.

Have a good one.
 

Watch MrExcel Video

Forum statistics

Threads
1,119,097
Messages
5,576,113
Members
412,697
Latest member
ahem27
Top