Solved filter to run when a cell has been changed

April 20, 2017 at 15:34:00
Specs: Windows 7
say have a list of tasks and i have a filter applied to show only "In Progress". When i change that task to "On hold" or "Completed" i would like them to disappear from the list. how can i get the filter to do this automatically without me having to click refresh?

See More: filter to run when a cell has been changed

Reply ↓  Report •


#1
April 21, 2017 at 06:03:05
✔ Best Answer
Have you considered a Worksheet_Change macro?

Maybe something like this?

Private Sub Worksheet_Change(ByVal Target As Range)
    ActiveSheet.AutoFilter.ApplyFilter
End Sub


Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Reply ↓  Report •

#2
April 22, 2017 at 12:23:42
Is there any way to have this work with two worksheets? I tried doing:

Private Sub Worksheet_Change(ByVal Target As Range)
    ActiveSheet.AutoFilter.ApplyFilter
     Sheets("Gantt").AutoFiltr.ApplyFilter
End Sub

Didnt work :(

message edited by MattExcel


Reply ↓  Report •

#3
April 22, 2017 at 12:52:10
Sure, just put it in both worksheets. However, you can only have one Worksheet_Change in any given sheet, so if you are talking about the same sheets as in your other thread, you may run into problems when you add the Filter code to the "move row" code. The only way to know is to play around.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Reply ↓  Report •
Related Solutions


Ask Question