B
BNT1 via OfficeKB.com
Hi
I am tring to get a macro to change the maximum scale value in a chart, based
on a cell in the data sheet. In this case G5 in data "sheet1". In cell G5 ,
I have the max formulaI have named the chart "test". I have pasted the code
in a module, and if, with help, it works, will paste the second code in "This
workbook". As you no doubt guessed, I am not too familar with VBA, and have
managed to get hold of this code, however, it is failing.
Help appriciated
Regards
Sub UpdateScale()
ActiveSheet.ChartObjects("test").Activate
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = Range("G5").Value
End With
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
mySelection = ActiveWindow.RangeSelection.Address
UpdateScale
Range(mySelection).Select
End Sub
I am tring to get a macro to change the maximum scale value in a chart, based
on a cell in the data sheet. In this case G5 in data "sheet1". In cell G5 ,
I have the max formulaI have named the chart "test". I have pasted the code
in a module, and if, with help, it works, will paste the second code in "This
workbook". As you no doubt guessed, I am not too familar with VBA, and have
managed to get hold of this code, however, it is failing.
Help appriciated
Regards
Sub UpdateScale()
ActiveSheet.ChartObjects("test").Activate
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = Range("G5").Value
End With
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
mySelection = ActiveWindow.RangeSelection.Address
UpdateScale
Range(mySelection).Select
End Sub