hello everyone,
my code below works only when my waterfall chart has no unit , but once i update its unit in excel the code malfunction .
here is the code :
Private Sub Worksheet_Change(ByVal Target As Range)
If Sheets("Sheet2").Range("B5").Value <> 0 Then
Set mychart = Sheets("Sheet2").ChartObjects("Chart 8").Chart
With mychart.Axes(xlValue)
.MinimumScale = 0.9 * Application.WorksheetFunction.Min(Sheets("Sheet2").Range("b5:b51").Value)
.MaximumScale = 1.1 * Application.WorksheetFunction.Max(Sheets("Sheet2").Range("b5:b51").Value)
End With
End If
End Sub
Thanks
my code below works only when my waterfall chart has no unit , but once i update its unit in excel the code malfunction .
here is the code :
Private Sub Worksheet_Change(ByVal Target As Range)
If Sheets("Sheet2").Range("B5").Value <> 0 Then
Set mychart = Sheets("Sheet2").ChartObjects("Chart 8").Chart
With mychart.Axes(xlValue)
.MinimumScale = 0.9 * Application.WorksheetFunction.Min(Sheets("Sheet2").Range("b5:b51").Value)
.MaximumScale = 1.1 * Application.WorksheetFunction.Max(Sheets("Sheet2").Range("b5:b51").Value)
End With
End If
End Sub
Thanks