Macro Chart Ranges

  • Thread starter Thread starter Reto Walker
  • Start date Start date
R

Reto Walker

Hi everyone

How can I adjust the following macro to make the MinimumScale value and
MaximumScale value dynamic (by referencing a cell in one of my spreadsheets)
instead of fixed (currently 5400 and 7000)

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 3/15/04 by Reto Walker
'

'
ActiveSheet.ChartObjects("Chart 4").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 5400
.MaximumScale = 7000
.MinorUnit = 100
.MajorUnit = 500
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
End Sub

Thanks in advance

Regards,

Reto
 
Hi Reto,

The following will use the values in A1 and A2 on Sheet1.

..MinimumScale = Worksheets("Sheet1").Range("A1").value
..MaximumScale = Worksheets("Sheet1").Range("A2").value

Cheers
Andy
 
Back
Top