Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel 2010 slicer - use selected item in graph headline

Posted on 2013-11-28
2
Medium Priority
?
631 Views
Last Modified: 2013-11-28
I have a "slicer" object in a Excel 2010 sheet, used to control 2 Graphs. How can I show the selected item name from the Slicer and show it in the graph headline text field ?

Please advice
Thanks
Mik
0
Comment
Question by:Bojerne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 1

Assisted Solution

by:Bojerne
Bojerne earned 0 total points
ID: 39683325
Found this I can use for part of the task :)
Private Sub Worksheet_PivotTableChangeSync(ByVal Target As PivotTable)
    Dim slItem As SlicerItem

   
    '---Optional: Exclude one or more PivotTables from triggering action
    If Target.Name = "PivotTable2" Then Exit Sub

   
    With ActiveWorkbook.SlicerCaches("Slicer_MyField")
        '---display selected items in the Immediate Window of the VB Editor
        Debug.Print "Visible Slicer Items: "

       
        For Each slItem In .VisibleSlicerItems
            Debug.Print slItem.Name
        Next slItem

       
        Debug.Print "~~~~~~~~~~~~~~~~~~"
    End With
End Sub
0
 
LVL 1

Accepted Solution

by:
Bojerne earned 0 total points
ID: 39683342
Second part can be solved with this :)

Sub Macro1()
ActiveSheet.ChartObjects(1).Chart. _
ChartTitle.Characters.Text = "Text"
End Sub
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question