Sep 30 2022 02:35 AM
Hi,
I have a table automaticly updates when I add something on another worksheet.
The automatic generated list has a filter on it, to hide the empty cells. Can I make a macro (private sub?) that automaticly refreshes the filter when I open that worsheet?
Because I do not change anything manually this code doesn't work
Private Sub Worksheet_Change(ByVal Target As Range) Sheets("Sheet3").AutoFilter.ApplyFilter End Sub
Can I use a code that runs by opening?
Sep 30 2022 02:53 AM
SolutionI'd use two event procedures. In the ThisWorkbook module:
Private Sub Workbook_Open()
Sheets("Sheet3").AutoFilter.ApplyFilter
End Sub
and in the worksheet module of Sheet3:
Private Sub Worksheet_Activate()
Me.AutoFilter.ApplyFilter
End Sub