+ Reply to Thread
Results 1 to 7 of 7

Change series line colour to match marker colours

  1. #1
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Change series line colour to match marker colours

    Hello All,

    I am struggling to complete a macro that generates a standardised XY scatter chart.


    I would like to add a line (or change the already present line) to the data series that is the same color as the automatically formatted points.

    I have tried various combinations of markerforegroundcolor, points(x).colorindex and seriescollection().format.line.color, but to no avail.

    Any help gratefully received.
    Last edited by sweep; 09-15-2014 at 03:05 AM. Reason: Solved
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Change series line colour to match marker colours

    Something like this?

    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Change series line colour to match marker colours

    Thanks millz, I'd got that far, but what I don't seem to be able to do is set the line colour to the current colour of the marker points.

    Please Login or Register  to view this content.
    Last edited by sweep; 09-12-2014 at 05:25 AM. Reason: excessive punctuation

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Change series line colour to match marker colours

    Does this not work?
    Please Login or Register  to view this content.

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Change series line colour to match marker colours

    Peculiarly, it doesn't.

    Here's a portion of the code.

    Please Login or Register  to view this content.
    The datapoints are coloured blue, but when a enter

    Please Login or Register  to view this content.
    into the immediate window, it returns -1

  6. #6
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Change series line colour to match marker colours

    Hmmm. Well, if it's returning -1, it means it's set to automatic colours.

    Maybe this to set the line's colour to automatic as well?
    Please Login or Register  to view this content.
    Also, I notice you are setting the line to visible, are you trying to make an on/off feature?
    Maybe change chart type instead?
    Please Login or Register  to view this content.

  7. #7
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Change series line colour to match marker colours

    Thanks Millz,

    this did it:
    Please Login or Register  to view this content.

+ 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. [SOLVED] Excel VBA: change marker styles for all series excluding unmarked lines
    By sonofamonkey10 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-05-2014, 03:29 PM
  2. Macro with IF statement for if a series exists change colour of line in graph
    By sim410 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-21-2012, 06:20 AM
  3. VBA to change label, marker style and colour
    By Rajoli in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-27-2012, 08:31 AM
  4. reformatting both line and marker style for all series
    By cwyn in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 04-16-2012, 07:21 AM
  5. Chart. Marker line length. How to change
    By Richard Buttrey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-05-2010, 05:02 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