pbinvestor
New Member
- Joined
- Apr 14, 2002
- Messages
- 19
Through the good advice of Healey21 very elegantly was able to rescale my x axis charts using cell inputs with the following code:
Sub Format_charts()
With ActiveSheet.ChartObjects("Chart 6").Chart.Axes(xlValue)
.MaximumScale = Range("v18").Value
.MinimumScale = Range("u18").Value
End With
End Sub
Now I need to scale the Y axis using text categories (stock symbols like SPX,DOW,MMM,AAPL etc.)
All are contained in the range bounded by d13:R13.
Here was my feeble attempt ..
I tried to do the same thing with the y axis by adding the code below using "d13" and "r13" as the category variables but got runtime error 13 "type mismatch"
With ActiveSheet.ChartObjects("Chart 6").Chart.Axes(xlCategory)
.MaximumScale = ActiveSheet.Range("d13").Value
.MinimumScale = ActiveSheet.Range("r13").Value
End With
I guess that the ranges are looking for numbers as opposed to text fields but don't know how to specify (or it seems it should be more complicated than that).
Thanks in advance
Sub Format_charts()
With ActiveSheet.ChartObjects("Chart 6").Chart.Axes(xlValue)
.MaximumScale = Range("v18").Value
.MinimumScale = Range("u18").Value
End With
End Sub
Now I need to scale the Y axis using text categories (stock symbols like SPX,DOW,MMM,AAPL etc.)
All are contained in the range bounded by d13:R13.
Here was my feeble attempt ..
I tried to do the same thing with the y axis by adding the code below using "d13" and "r13" as the category variables but got runtime error 13 "type mismatch"
With ActiveSheet.ChartObjects("Chart 6").Chart.Axes(xlCategory)
.MaximumScale = ActiveSheet.Range("d13").Value
.MinimumScale = ActiveSheet.Range("r13").Value
End With
I guess that the ranges are looking for numbers as opposed to text fields but don't know how to specify (or it seems it should be more complicated than that).
Thanks in advance