I created a macro that filters based on a cell value which works fine.
Range("A1:L1").AutoFilter Field:=4, Criteria1:=Range("U1")
I need this macro to run everytime the cell value changes. I wrote a macro but it is not working i dont get any errors just nothing happens.
I tried:
Private Sub Worksheet_Tabelle1(ByVal Target As Range)
If Target.Address = "$U$1" Then
Application.EnableEvents = False
Range("A1:L1").AutoFilter Field:=4, Criteria1:=Range("U1")
Application.EnableEvents = True
End If
End Sub
This version should just execute the code and not call a macro. I changed the Worksheet_xxxxx to the sheet name and tried other things.
I also tried:
Private Sub Worksheet_Arbeitstabelle(ByVal Target As Range)
If Target.Address = "$U$1" Then
Call Macro1
End If
End Sub
This version should call the following Macro:
Sub Macro1()
Range("A1:L1").AutoFilter Field:=4, Criteria1:=Range("U1")
End Sub
I put all the Private Sub macros on the Worksheet and the Macro1 in a modul. The file is .xlsm and doesnt have any problem running other macros so i dont know why its not working. My guess is i probably did something wrong with the names so here are the names: