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!!
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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.
 
Upvote 0
AWESOME!!!

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

Have a good one.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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
Back
Top