I have a macro which previously triggered on a cell change but for some reason now it fails to trigger. I'm not sure what has changed to have caused this. All the macro has to do is refresh 4 pivots, which can be done manually no problem.
I've tried different ways of setting up a macro to trigger on a cell change, however they all fail to trigger on cell change.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("V76:W76")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
Sheets("NATFLOW").PivotTables("PivotTableA2").PivotCache.Refresh
Sheets("NATFLOW").PivotTables("PivotTableB2").PivotCache.Refresh
Sheets("NATTABLE").PivotTables("PivotTableAlpha2").PivotCache.Refresh
Sheets("NATTABLE").PivotTables("PivotTableBeta2").PivotCache.Refresh
End If
End Sub
The outcome is that nothing happens, including no error messages.
Application.EnableEvents = Falseapplied. Try running a piece of code to turn this toTrueto see if your event triggers like it should.