ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How can I auto refresh a column that has an auto filter in place (https://www.excelbanter.com/excel-discussion-misc-queries/170077-how-can-i-auto-refresh-column-has-auto-filter-place.html)

Pastal

How can I auto refresh a column that has an auto filter in place
 
I am workin in Excel, and have an issue with filtering a column
automatically. The column is fed by formulas in the cells. I want to auto
filter the column (non-blanks) and this works fine. However, when the input
data is changed, and the column fills with new values, the filter is not
automatically re-applied, and I have to manually re-apply it. How can I
automize this process?

Gary''s Student

How can I auto refresh a column that has an auto filter in place
 
This example uses data in column A. The macro will automatically refresh the
autofilter whenever formulas are calculated:

Private Sub Worksheet_Calculate()
Application.EnableEvents = False
Set r = ActiveCell
Columns("A:A").Select
Application.CutCopyMode = False
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<"
r.Select
Application.EnableEvents = True
End Sub

Note that this is Event code and goes in the worksheet code area, not a
standard module.
--
Gary''s Student - gsnu200761


"Pastal" wrote:

I am workin in Excel, and have an issue with filtering a column
automatically. The column is fed by formulas in the cells. I want to auto
filter the column (non-blanks) and this works fine. However, when the input
data is changed, and the column fills with new values, the filter is not
automatically re-applied, and I have to manually re-apply it. How can I
automize this process?



All times are GMT +1. The time now is 05:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com