Hi,
want to check if a cell changes, and based on it´s new value perform an action.
Tried with
but nothing happens.
Any ideas?
want to check if a cell changes, and based on it´s new value perform an action.
Tried with
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range("D1")) Is Nothing Then
If Range("D1").Value = "1" Then
Range("B4").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("Global Ultimate").AutoSort _
xlAscending, "Sum of NFR Total", ActiveSheet.PivotTables("PivotTable1"). _
PivotColumnAxis.PivotLines(1), 1
ElseIf Range("B4").Value = "2" Then
ActiveSheet.PivotTables("PivotTable1").PivotFields("Global Ultimate").AutoSort _
xlDescending, "Sum of NFR Total", ActiveSheet.PivotTables("PivotTable1"). _
PivotColumnAxis.PivotLines(1), 1
End If
End Sub
but nothing happens.
Any ideas?