View Single Post
  #2   Report Post  
Rowan Drummond
 
Posts: n/a
Default Axis label that corresponds to cell

Assuming the chart is an embeded object on the sheet and is called
"Chart 1" then this will change the Y axis title every time AD11 is changed:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim chrt As ChartObject
Dim axs As AxisTitle
If Target.Address = "$AD$11" Then
Set chrt = Me.ChartObjects("Chart 1")
Set axs = chrt.Chart.Axes(xlValue).AxisTitle
axs.Characters.Text = Target.Value
End If
End Sub

This is worksheet event code. Right click the sheet tab, select View
Code and paste the code in there.

Hope this helps
Rowan

pete3589 wrote:
I have an interactive graph which graphs data from a set column. This
column changes depending on what is selected on a list selector. I was
wondering if there is a way to label the y axis whatever was in, say
cell AD11.

I was hoping that that this would be something easy that I could write
into the excel chart wizard, like =$AD$11, but it is not. Any help
would be appreciated.