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

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 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,123,456
Messages
5,601,772
Members
414,472
Latest member
Chris_1990

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top