I have this Gantt Chart and i'm looking at Planned Vs Actual dates.
the problem is that the chart wont sync the start/end date.
i'm trying to link the max/min values to the cell with VBA but it wont to it.
I tried to use this site:
https://peltiertech.com/link-excel-chart-axis-scale-to-values-in-cells/
but his code doesn't work for my chart.
the dates MUST be the same, and change together if i change some values in the table on the right
any ideas?
thanks
Private Sub Worksheet_Change(ByVal Target As Range)
With ActiveSheet.ChartObjects("Chart 2").Chart
Select Case Target.Address
Case "$G$161"
.Axes(xlCategory).MaximumScale = Target.Value
Case "$F$163"
.Axes(xlCategory).MinimumScale = Target.Value
Case "$G$161"
.Axes(xlValue).MaximumScale = Target.Value
Case "$F$163"
.Axes(xlValue).MinimumScale = Target.Value
End Select
End With
End Sub
No comments:
Post a Comment