Solved

Excel 2010 slicer - use selected item in graph headline

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now