Results 1 to 3 of 3

Thread: How to get Excel Chart Title source?

  1. #1

    Thread Starter
    Fanatic Member VBAhack's Avatar
    Join Date
    Dec 2004
    Location
    Sector 000
    Posts
    617

    How to get Excel Chart Title source?

    I can set an Excel Chart title to a range or a named range with VBA but if I inqiure I just get the actual value. How to find out what the Title reference is if there is one?

    Code:
        ActiveChart.ChartTitle.Text = "=Test1!R3C10"
        ActiveChart.ChartTitle.Text = "=Sheet1!ChtTitle"
        Debug.Print ActiveChart.ChartTitle.Text '==> Derivative

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: How to get Excel Chart Title source?

    Code:
    Sub chartit()
        Dim myChart As Chart
        Dim mySheet As Worksheet
        
        Set mySheet = ActiveSheet
        Set myChart = mySheet.ChartObjects(1).Chart
        
        MsgBox myChart.ChartTitle.Formula
        
    End Sub

  3. #3

    Thread Starter
    Fanatic Member VBAhack's Avatar
    Join Date
    Dec 2004
    Location
    Sector 000
    Posts
    617

    Re: How to get Excel Chart Title source?

    Thanks. Even though the target platform was MsOf10 (work) I was using MsOf03 (home) for debug. It works OK on MsOf10 but not on MsOf03 (Object doesn't support this property). Any idea how to get chart title formula w/ MsOf03? I'm guessing it's not possible. I see nothing in the object model that would seem to work.

Posting Permissions

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



Click Here to Expand Forum to Full Width