+ Reply to Thread
Results 1 to 6 of 6

Select Pie Chart Slices by Name to recolour

  1. #1
    Registered User
    Join Date
    02-09-2012
    Location
    Melbourne
    MS-Off Ver
    365
    Posts
    17

    Question Select Pie Chart Slices by Name to recolour

    Hi

    I've been trying to assign certain colours to Pie Chart slices. The following code does work, however I'd prefer to refer to the slice by name instead of number because the items in the pie chart won't always be in the same order.


    This code works:

    Please Login or Register  to view this content.
    This code does not work, but I want to use a name:

    Please Login or Register  to view this content.

    The Microsoft help does state that Points(index) is a Variant and a name or number can be used, but if I use a name, I get a "Type Mismatch" error, which tells me that it only wants a number.

    Hopefully somebody out there knows a way to achieve this.

    Thanks in advance
    Attached Files Attached Files
    Last edited by BlankPage; 09-27-2012 at 09:27 AM.

  2. #2
    Registered User
    Join Date
    02-09-2012
    Location
    Melbourne
    MS-Off Ver
    365
    Posts
    17

    Re: Select Pie Chart Slices by Name to recolour

    Bump no response

  3. #3
    Registered User
    Join Date
    02-09-2012
    Location
    Melbourne
    MS-Off Ver
    365
    Posts
    17

    Re: Select Pie Chart Slices by Name to recolour

    Bump no response

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

    Re: Select Pie Chart Slices by Name to recolour

    You can only access the Point collection via a numeric index.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    02-09-2012
    Location
    Melbourne
    MS-Off Ver
    365
    Posts
    17

    Re: Select Pie Chart Slices by Name to recolour

    Thanks Andy, that makes sense. Thanks for your time! I'm going to be using this a lot in my current project!

  6. #6
    Registered User
    Join Date
    01-14-2013
    Location
    Moscow
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Select Pie Chart Slices by Name to recolour

    I found the solve here: http://www.mrexcel.com/forum/excel-q...nt-colors.html
    1) backup datalabels (depth of backup such as text, position, e.t.c. choose yourself)
    2) set category name on labels -> obtain point's name
    (only datalables we can read, because there are no get property for XValues)
    3) coloring point
    4) restore datalabels from backup
    5) ...
    6) PROFIT

    UPDATE !!!
    application match - is much much better, thanks and sorry for hurrying.
    NOte: in powerpoint I use excel.application.match
    Last edited by Belthazor4; 01-14-2013 at 09:39 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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