View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Idgarad Idgarad is offline
external usenet poster
 
Posts: 9
Default Touble with Dynamix Axis Scales via a Cell Value

I have had one heck of a time trying to implement the following code
snippet from http://peltiertech.com/Excel/Charts/...nkToSheet.html

---SNIP---
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$E$2"
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory) _
.MaximumScale = Target.Value
Case "$E$3"
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory) _
.MinimumScale = Target.Value
Case Else
End Select
End Sub
--- SNIP ---


I assumed to the best of my ability the following

---SNIP---
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$E$2"
chart4.ChartObjects("CHART-Drawdown").Chart.Axes(xlCategory) _
.MaximumScale = Target.Value
Case "$E$3"
chart5.ChartObjects("CHART-Sliding
Average").Chart.Axes(xlCategory) _
.MinimumScale = Target.Value
Case "$F$2"
chart4.ChartObjects("CHART-Drawdown").Chart.Axes(xlCategory) _
.MinimumScale = Target.Value
Case "$F$3"
chart5.ChartObjects("CHART-Sliding
Average").Chart.Axes(xlCategory) _
.MaximumScale = Target.Value

Case Else
End Select
End Sub
---SNIP---

The trouble is that it is originally written to work with an embedded
chart on the same page. I tried converting it to handle Chart sheets
but to no avail. What needs to be correctly modified to reference a
chart page?