Solved

Excel 2010 slicer - use selected item in graph headline

Posted on 2013-11-28
2
613 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

630 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