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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

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,112,883
Messages
5,543,017
Members
410,583
Latest member
gazz57
Top