+ Reply to Thread
Results 1 to 5 of 5

how can I change the order of trendlines in a legend?

  1. #1
    dutchy
    Guest

    how can I change the order of trendlines in a legend?

    I've got a chart in excell with some trendlines. THey are however in the
    legend in the wrong order. Is it possible to change the order of the
    trendlines in the legend?

  2. #2
    Andy Pope
    Guest

    Re: how can I change the order of trendlines in a legend?

    Hi,

    Looks like the order of trendlines is simply the order they were added
    and once added, unlike the normal chart series, you can not change the
    order.

    Cheers
    Andy

    dutchy wrote:
    > I've got a chart in excell with some trendlines. THey are however in the
    > legend in the wrong order. Is it possible to change the order of the
    > trendlines in the legend?


    --

    Andy Pope, Microsoft MVP - Excel
    http://www.andypope.info

  3. #3
    Registered User
    Join Date
    10-03-2011
    Location
    San Jose, CA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: how can I change the order of trendlines in a legend?

    Actually they only follow the order that they were created until you close and reopen the file (or copy and paste the chart). After that they will be arranged according to the data series order. (Select any data series in the chart > right click > format data series > series order).

  4. #4
    Registered User
    Join Date
    07-21-2011
    Location
    RF, Samara
    MS-Off Ver
    Excel 2003&2007
    Posts
    8

    Re: how can I change the order of trendlines in a legend?

    you can create right order by using vba code.

    ActiveSheet.Shapes.AddChart
    Worksheets("sheet1").ChartObjects(1).Activate
    ActiveChart.Axes(xlValue).MajorGridlines.Select
    ActiveChart.PlotArea.Select

    With ActiveChart

    .ChartArea.Left = 350
    .ChartArea.Top = 150

    .ChartType = xlLineMarkers
    ' add series from selected range, column by column
    .SeriesCollection.NewSeries
    With .SeriesCollection(1)
    .Values = Worksheets("sheet1").Range("$C$4:$C$45")
    .XValues = Worksheets("sheet1").Range("$A$4:$A$45")
    .Name = "val"
    End With

    With .SeriesCollection(2)
    .Values = Worksheets("sheet1").Range("$D$4:$D$45")
    .XValues = Worksheets("sheet1").Range("$A$4:$A$45")
    .Name = "val"
    End With
    '...

    End With

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: how can I change the order of trendlines in a legend?

    Egonomist,

    I doubt the OP will read your answer after 5 years.

    Furthermore,


    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

+ 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