+ Reply to Thread
Results 1 to 3 of 3

Dynamic title on pivot chart

  1. #1
    Registered User
    Join Date
    04-30-2013
    Location
    Swindon England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Dynamic title on pivot chart

    Hi,

    I'm trying to add a dynamic title to a pivot chart which has Pivot Field Buttons. I want the chart title to reflect any filters that are selected in the pivot fields so that the user is immediatly aware that the char is using filtered data rather than having to click on the pivot field to see what the filter is.

    I can get the following VB commnads to work and it puts the value in the title and if I use the Pivot fields to filter the data it changes the title accordingly which is great. For example if I don't have a filter on the title is (ALL) as I expect.


    ActiveChart.SetElement (msoElementChartTitleAboveChart)
    Selection.Caption = "='Downtime Hours Pivot Data'!R1C2"



    However, rather that just the value being displayed in ther title I would like to make it more user readable by adding a string to the beginning of the title. I would like the title to look something like Mylabel: <value>

    I've tried loads of different ways to try and add a string to the title but just cant get it to display correctly. Anyone got any advice or thoughts?

    Thanks

    Paul

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Dynamic title on pivot chart

    Selection.Caption = "My Text " & 'Downtime Hours Pivot Data'!R1C2
    Elegant Simplicity............. Not Always

  3. #3
    Registered User
    Join Date
    04-30-2013
    Location
    Swindon England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Unhappy Re: Dynamic title on pivot chart

    Hi Andy,

    I'm afraid that it does not work. I am still getting a compiler error when I run the code. I agree woith you that it looks like it should work but for some reason it does not.

    This has really got me stumped!

    thanks

    Paul

+ 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