+ Reply to Thread
Results 1 to 14 of 14

Pivotchart's Pie Title

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-25-2008
    Location
    texas
    Posts
    178

    Pivotchart's Pie Title

    I can save a macro that builds the Pie chart from the column. It does everything but let me assign a title to the pie chart. I have to do that manually . Is there a way to assign a title thru a macro?
    This is obviously a charting and a macro question but I took a chance and put it under the charting forum.
    Last edited by jartzh; 02-20-2009 at 12:45 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,444

    Re: Pivotchart's Pie Title

    something like this
    activechart.ChartTitle.Text = "My Title"
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    07-25-2008
    Location
    texas
    Posts
    178

    Re: Pivotchart's Pie Title

    Brilliant!
    Is there a way to put the values of cell A1 in the title?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,444

    Re: Pivotchart's Pie Title

    activechart.ChartTitle.Text = "A1 value is " & worksheets("Sheet1").range("A1").value
    Or you can link the chart title to the cell.
    http://www.andypope.info/tips/tip001.htm

  5. #5
    Forum Contributor
    Join Date
    07-25-2008
    Location
    texas
    Posts
    178

    Re: Pivotchart's Pie Title

    Andy,
    Can I use activesheet to specify the cell?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,444

    Re: Pivotchart's Pie Title

    Only if the activechart is an object within a worksheet.
    Otherwise the activesheet will be the chart sheet and chart sheets do not have cells.

  7. #7
    Forum Contributor
    Join Date
    07-25-2008
    Location
    texas
    Posts
    178

    Re: Pivotchart's Pie Title

    Andy,
    I have the data for the chart in col A and I would like cell B1 to be the title. But I want it to work on any of the 12 worksheets in the workbook.
    So I need to say "just grab the value in B1 on the active worksheet".

    Is that possible?

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,444

    Re: Pivotchart's Pie Title

    As I said if the Activechart is on the same sheet as the cell B1 then yes.

    activechart.ChartTitle.Text = "A1 value is " & activesheet.range("B1").value
    If your chart is on it's own chart sheet then no as the activesheet will then be the chart and not any of those with a B1 cell

  9. #9
    Forum Contributor
    Join Date
    07-25-2008
    Location
    texas
    Posts
    178

    Re: Pivotchart's Pie Title

    Andy,
    Thats why I am having this problem. I have 12 worksheets and want to build a single macro that will build a chart on whatever worksheet I am on at that time. That part works fine but I can't title it.


    Just fishing here but :
    What about if I had a seperate worksheet that would get the title from it based on the name of the active worksheet?

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,444

    Re: Pivotchart's Pie Title

    can you post what you have so far?

  11. #11
    Forum Contributor
    Join Date
    07-25-2008
    Location
    texas
    Posts
    178

    Re: Pivotchart's Pie Title

    Andy,
    Sure here it is. It only works up thru the job experience worksheet now.
    If you go to the classificationdata worksheet and use the removechart macro to clean off the worksheet, then use the buildchart macro to build the chart from the contents of col A.

    I think since it uses a template so you wont be able to build the chart .
    Attached Files Attached Files

+ 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