+ Reply to Thread
Results 1 to 5 of 5

Process chart by looping through Chart CategoryCollection

  1. #1
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Process chart by looping through Chart CategoryCollection

    Hi everyone.
    I need to process charts by looping through the CategoryCollection and reading the associated labels.
    I know how to do this for a series, but I can't work out how to get the label from the category.

    Every example I've found online works from the series object, but this doesn't help me to filter the categories.

    Please Login or Register  to view this content.

    EDIT
    I've now posted this on another forum at
    http://www.vbaexpress.com/forum/show...-x-axis-labels
    Last edited by truk2; 06-14-2021 at 04:51 PM. Reason: mentioning a cross posy
    If my solution helped, please consider adding Rep

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

    Re: Process chart by looping through Chart CategoryCollection

    Here are a couple of ways

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

  3. #3
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Process chart by looping through Chart CategoryCollection

    Hi Andy,

    Those are both nice ways to be able to loop through the category names.
    But the first one is accessing the text via the Chart.Axes method.
    The second one is accessing the text via the Series.XValues property.

    Neither has a reference to the category or CategoryCollection objects, so how could I do anything with it? I need to get to this line:
    Please Login or Register  to view this content.

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

    Re: Process chart by looping through Chart CategoryCollection

    You mentioned Labels not IsFiltered

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Process chart by looping through Chart CategoryCollection

    Quote Originally Posted by Andy Pope View Post
    You mentioned Labels not IsFiltered
    I did mention several times that my aim was to work with a reference to the category object. I only mentioned .IsFiltered as an example of using the category object, as was shown in my original code.

    Quote Originally Posted by Andy Pope View Post
    Please Login or Register  to view this content.
    .Name is not a property of the Category object, and is thus not a method available to the FullCategoryCollection

    https://docs.microsoft.com/en-us/off....chartcategory
    https://docs.microsoft.com/en-us/off...gorycollection

    So I figure that there has to be a way to step back through the parent objects from the label to the category or vice versa. But I can't work it out.

+ 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. Process comparaison chart
    By Foxhoud in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-12-2019, 03:21 PM
  2. [SOLVED] High-low-average chart with 3 lines per process
    By dreddster in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 06-09-2015, 03:31 AM
  3. Making an out of control process look different in SPC chart
    By blake.b.8726 in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 03-05-2015, 11:26 AM
  4. Replies: 0
    Last Post: 11-10-2014, 10:52 AM
  5. Process Behaviour Chart (One line of data) - Any good ideas?
    By wintheranders in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-06-2013, 03:48 AM
  6. [SOLVED] Statistical Process Control chart
    By Tang Leep Boon in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-25-2011, 02:10 AM
  7. Looping through chart worksheets
    By stuartmarsh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2006, 10:11 AM

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