+ Reply to Thread
Results 1 to 4 of 4

Axis label that corresponds to cell

  1. #1
    Registered User
    Join Date
    10-27-2005
    Posts
    16

    Axis label that corresponds to cell

    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.

  2. #2
    Rowan Drummond
    Guest

    Re: 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.
    >
    >


  3. #3
    Registered User
    Join Date
    10-27-2005
    Posts
    16
    Yes it did. Thank you Rowan

  4. #4
    Rowan Drummond
    Guest

    Re: Axis label that corresponds to cell

    You're welcome.

    pete3589 wrote:
    > Yes it did. Thank you Rowan
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1