this code modifies the axis of my waterfall chart automatically , it is connected with some slicers . now the waterfall chart is in sheet 5 but when I change the slicer from the sheet 2 (same slicer in two different sheets) the waterfall doesn't change .
here is my code :
Private Sub Worksheet_Change(ByVal Target As Range)
If ActiveSheet.Name = "Sheet3" Then
If ActiveSheet.Name = "Sheet2" Then
If Range("B5").Value <> 0 Then
ChartObjects("Chart 8").Activate
With ActiveChart.Axes(xlValue)
.MinimumScale = 0.9 * Application.WorksheetFunction.Min(Range("b5:b51").Value)
.MaximumScale = 1.1 * Application.WorksheetFunction.Max(Range("b5:b51").Value)
End With
Range("A1").Select
End If
End If
End If
End Sub
here is my code :
Private Sub Worksheet_Change(ByVal Target As Range)
If ActiveSheet.Name = "Sheet3" Then
If ActiveSheet.Name = "Sheet2" Then
If Range("B5").Value <> 0 Then
ChartObjects("Chart 8").Activate
With ActiveChart.Axes(xlValue)
.MinimumScale = 0.9 * Application.WorksheetFunction.Min(Range("b5:b51").Value)
.MaximumScale = 1.1 * Application.WorksheetFunction.Max(Range("b5:b51").Value)
End With
Range("A1").Select
End If
End If
End If
End Sub