現在、データを自動フィルタリングするマクロがあります。セルが変更されたときに自動的に実行することができません。セルの値が変わるたびにマクロを実行したい。どんな種類の助けにも感謝するでしょう。コードを配置するワークシートに問題があるのではないかと思います。
私のコードは次のとおりです。
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed. In this case,
' Cell B2 will be changed when a value is selected on
' another worksheet.
Set KeyCells = Range("B1:B2")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' Perform advanced filter on data
' Place your code here.
Range("B4:H976").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range("SalesByLocation!Criteria"), Unique:=False
End If
End Sub