+ Reply to Thread
Results 1 to 4 of 4

Change all data markers (excel chart) to triangles in one command

  1. #1
    jawn
    Guest

    Change all data markers (excel chart) to triangles in one command


    There must be some command which tells a new chart to randomize colors and
    symbols- this can look junky. I would llike to find a way to change all
    symbols simultaneouly to various shapes until I find what makes the chart
    most read-able.
    thankyou

  2. #2
    Jon Peltier
    Guest

    Re: Change all data markers (excel chart) to triangles in one command

    It's not a single command. You need to loop through the series in a chart
    and apply colors and symbols as you see fit. This procedure cycles among the
    marker shapes in a line or XY chart:

    Sub RotateMarkers()
    Dim srs As Series
    Dim NewMarker As Long

    Select Case ActiveChart.SeriesCollection(1).MarkerStyle
    Case xlMarkerStyleCircle
    NewMarker = xlMarkerStyleDiamond
    Case xlMarkerStyleDiamond
    NewMarker = xlMarkerStyleSquare
    Case xlMarkerStyleSquare
    NewMarker = xlMarkerStyleTriangle
    Case xlMarkerStyleTriangle
    NewMarker = xlMarkerStylePlus
    Case xlMarkerStylePlus
    NewMarker = xlMarkerStyleStar
    Case xlMarkerStyleStar
    NewMarker = xlMarkerStyleX
    Case xlMarkerStyleX
    NewMarker = xlMarkerStyleCircle
    Case Else
    NewMarker = xlMarkerStyleCircle
    End Select

    For Each srs In ActiveChart.SeriesCollection
    srs.MarkerStyle = NewMarker
    Next
    End Sub

    - Jon
    -------
    Jon Peltier, Microsoft Excel MVP
    Peltier Technical Services
    Tutorials and Custom Solutions
    http://PeltierTech.com/
    _______

    "jawn" <[email protected]> wrote in message
    news:[email protected]...
    >
    > There must be some command which tells a new chart to randomize colors and
    > symbols- this can look junky. I would llike to find a way to change all
    > symbols simultaneouly to various shapes until I find what makes the chart
    > most read-able.
    > thankyou




  3. #3
    Registered User
    Join Date
    09-26-2012
    Location
    Austin
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Change all data markers (excel chart) to triangles in one command

    John, very slick macro.

    Would there be a way to have a non-marker option be part of the rotation?

  4. #4
    Registered User
    Join Date
    07-09-2012
    Location
    Iron Mountain, MI
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Change all data markers (excel chart) to triangles in one command

    El_Duderino,

    You are looking for:
    NewMarker = xlMarkerStyleNone

    Also, I would recommended changing the line:
    Dim NewMarker As Long
    to
    Dim NewMarker As XlMarkerStyle

    Both versions will work in code, but if you use the one I suggest, Excels VBA will give you a list of possible values to choose from for NewMarker anytime you type NewMarker= in your code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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