+ Reply to Thread
Results 1 to 3 of 3

How to find which Treemap box is selected.

  1. #1
    Registered User
    Join Date
    12-30-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    31

    How to find which Treemap box is selected.

    Hey Guys,

    I have a treemap chart in my dashboard. I'm trying to get the selected box category name to appear in a different cell. Wondering how do do that.

    Rgds, Anil

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to find which Treemap box is selected.

    Not a straightforward thing to but it is possible to get enough information to deduce what the area is.
    Unlike the standard charts you can not access the values or xvalues of the series so you have to create code to relate the reported information to your data source.

    First as your chart is on a worksheet you will need to create a class object to capture chart events.

    Using the events you can capture an index value that relates to the source data.

    On the worksheet I have added the arg2 values, G4:H19, next to the source source data, C4:E19. This was done manually but you should be able to create some code that works out the values from the label range.

    Use the button, Enable Chartobject Events, to create an object that will capture chart events and report the selected index to a cell, K2.
    Click the chart and select a section or subsection of the treemap to see contents of K2 change.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    12-30-2012
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    31

    Re: How to find which Treemap box is selected.

    Hey Andy,

    You are simply great... I was not hoping these couple of lines will do the magic. Before even I was posting my query here, I wassn't really sure if this was doable but yes your logic just worked like a butter absolutely smoothly.
    Many many thanks Andy.

    Kind Regards,
    Anil

+ 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. Is conditional formatting of a Treemap Chart even possible?
    By Ansatz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-20-2022, 12:23 AM
  2. [SOLVED] extract range from Treemap chart
    By Eastw00d in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2020, 04:24 AM
  3. Blank Legend Entries in Treemap Chart
    By AdelR in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 10-17-2019, 02:57 PM
  4. Treemap Issues
    By aglazar in forum Excel Charting & Pivots
    Replies: 14
    Last Post: 04-24-2018, 07:59 AM
  5. [SOLVED] Changing layout of treemap chart
    By Dennis Foldager in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-04-2018, 05:05 AM
  6. Treemap for Excel 2013
    By mike_christopher in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-24-2016, 04:34 PM
  7. treemap
    By rodich in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-19-2013, 05:34 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