+ Reply to Thread
Results 1 to 6 of 6

Changing the Chart Title automatically when a value in Slicer is selected

  1. #1
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Changing the Chart Title automatically when a value in Slicer is selected

    Hi

    I was wondering if anyone can help me. I have attached a very simple excel sample sheet with a pivot chart. I am trying to add a title to the chart which changes depending on what filter I use from my slicer. The tile should say "Sales per Department" and have the value of the slicer choice i.e. AAA or BBB or whatever is selected.

    This can be either in the title or maybe at the bottom stating which departments have been chosen for the chart. My Main spreadsheet is very large but once I know how this done I can apply it to my main spreadsheet

    I hope this makes sense.

    Any help is appreciate it.
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Changing the Chart Title automatically when a value in Slicer is selected

    Add a title to the chart, select it, and in the formula bar,

    =Sheet1!$D$12
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Changing the Chart Title automatically when a value in Slicer is selected

    Thanks for this. However when no Slicer is selected he title only shows the first one i.e. AAA. Is there anyway to make it showing all the filters i.e. aaa,bbb,ccc and so on. Also can I add a text in front f the formula to make it a bit more meaningful something like "The sale for the period" and then show the filtes chosen.

    Thanks n advance

  4. #4
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Changing the Chart Title automatically when a value in Slicer is selected

    You can - treat just like you do any other formula.

    Either do it on the title when selecting OR make the referenced cell for the title build out exactly what you want to see -

    ="YOUR TEXT "&'Cell Reference'
    -If you think you are done, Start over - ELeGault

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Changing the Chart Title automatically when a value in Slicer is selected

    You can use a UDF like this:
    Please Login or Register  to view this content.
    Which you call from a cell like this:
    =GetSlicerVals(D11,"Dept")
    (D11 should be the top left cell of your pivot table, and "Dept" is the slicer name)

    Note: I had to change your pivot table to not retain old data to prevent the function from returning all the old items that used to be in the pivot table as well. I can't currently find a way to restrict the code to only what the slicer actually shows - even using the VisibleSlicerItems collection has no effect)

    Your revised sample workbook is attached.
    Attached Files Attached Files
    Remember what the dormouse said
    Feed your head

  6. #6
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Changing the Chart Title automatically when a value in Slicer is selected

    Thank you for all your help. this works great

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Update Chart Title using slicer to filter chart
    By redil855 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2014, 10:18 AM
  2. [SOLVED] Change Chart Title Depending on a Slicer - slicer advice
    By JungleJme in forum Excel General
    Replies: 8
    Last Post: 08-17-2012, 07:59 AM
  3. Replies: 3
    Last Post: 12-01-2010, 04:55 AM
  4. Changing chart title default
    By shumba in forum Excel General
    Replies: 2
    Last Post: 06-22-2010, 08:57 PM
  5. Changing chart title changes position of chart
    By Bing in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-09-2005, 05:06 AM

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