+ Reply to Thread
Results 1 to 5 of 5

Excel VBA: change marker styles for all series excluding unmarked lines

  1. #1
    Registered User
    Join Date
    01-04-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010, 2013
    Posts
    17

    Excel VBA: change marker styles for all series excluding unmarked lines

    I have a macro that changes the marker style for all series in a scatter chart, chosen through an input box.

    Please Login or Register  to view this content.
    It works nicely, but I want it to exclude any series that do not have markers (i.e. lines used to indicate a reference value). I've tried an if-then statement after the With statement, but it will add markers to any line series:

    Please Login or Register  to view this content.
    Basically, if the series has markers or line+markers, I want it to change the marker style, otherwise do nothing with the series.
    Any suggestions?

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Excel VBA: change marker styles for all series excluding unmarked lines

    How about:

    Please Login or Register  to view this content.
    With no "End If" required
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    01-04-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010, 2013
    Posts
    17

    Re: Excel VBA: change marker styles for all series excluding unmarked lines

    xladept,

    thanks for the reply, but your suggestion didn't change anything. the series with plain lines still get converted to line+markers. (btw, all series are XY scatter).

    I will upload a snapshot and example workbook later when my computer lets me.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Excel VBA: change marker styles for all series excluding unmarked lines

    'Til then then

  5. #5
    Registered User
    Join Date
    01-04-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010, 2013
    Posts
    17

    Re: Excel VBA: change marker styles for all series excluding unmarked lines

    well, I think I resolved my issue; the .MarkerStyle syntax just needed a slight modification. Now, it will only modify series that have markers.

    Please Login or Register  to view this content.
    Thanks for giving it a look!
    Last edited by sonofamonkey10; 08-05-2014 at 01:47 PM.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Excel VBA: change marker styles for all series excluding unmarked lines

    Great - glad you figured it out! (You could still do it without the "End If" though)

+ 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. Can I associate excel marker style with series name?
    By Marmot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2013, 07:19 AM
  2. Series Marker on Chart
    By Ralem in forum Excel General
    Replies: 5
    Last Post: 04-20-2010, 04:17 AM
  3. adding extra marker styles
    By Grizzabella in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 09-15-2005, 12:05 AM
  4. new marker styles
    By Lis in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-30-2005, 07:05 PM
  5. How do I change a data series from bars to lines in an Excel char.
    By mrocke in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-28-2005, 09:06 PM

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