Automatically Refresh Autofilter

  • I have a worksheet set with Autofilter. This worksheet is populated by formulas taking data entered on another worksheet.


    I want the Autofilter for the first worksheet to automatically refresh each time I view that worksheet or as data is entered on the supporting worksheet.


    Any suggestions?

  • Re: Automatically Refresh Autofilter


    Put the next code into the Open event of the worksheet containing the filter :


    Code
    Selection.AutoFilter Field:=1, Criteria1:="Whatever"


    and the following code into the Change event of the worksheet you get the data from the web :


    Code
    Worksheets("Sheet1").Activate
    Selection.AutoFilter Field:=1, Criteria1:="Whatever"


    Erik

  • Re: Automatically Refresh Autofilter


    Thanks for the help, this gets me close but not quite want I want. I have the following code in my data source worksheet


    Code
    Private Sub Worksheet_Change(ByVal Target As Range)
    Worksheets("ACCRUALS DETAIL").Activate
    Selection.AutoFilter Field:=3, Criteria1:="<>"
    End Sub


    and the following in worksheet that provides me the filter:



    With this any time I make a change in the data source worksheet the worksheet changes to my filter worksheet. I want to be able to make multiple changes in the datasource worksheet without being redirected. The filter worksheet is a summary worksheet that may or may not be reviewed by the person making changes in the datasource sheet. However, upon viewing the filter worksheet I always want it to display the correctly filtered items.


    The above code works well but that it redirects me to the summary sheet with each and every change on the datasource sheet.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!