Hi All,
Feel like this one is easy but I can't find it... I have a task at work where I routinely plot several thousand coat weights and it's a bit tedious so I wrote a little macro to just take out the mundane nature of it. I wrote it so that I just select the 3 columns of data (always lower limit, weight, then upper limit) run the macro and it plots it as a new chart. It however always puts the legend in 'reverse order'... is there a way to reverse the order or change it?
I can do it manually but I'd like to just have it automatically reversed. right now it puts the lower limit on the top and the upper limit on the bottom (visually this is just upside down). Below is my code:
Any help would be appreciated. Bonus points if you can tell me how to make it so it automatically move the legend from the bottom (default) to the top right as well..
Feel like this one is easy but I can't find it... I have a task at work where I routinely plot several thousand coat weights and it's a bit tedious so I wrote a little macro to just take out the mundane nature of it. I wrote it so that I just select the 3 columns of data (always lower limit, weight, then upper limit) run the macro and it plots it as a new chart. It however always puts the legend in 'reverse order'... is there a way to reverse the order or change it?
I can do it manually but I'd like to just have it automatically reversed. right now it puts the lower limit on the top and the upper limit on the bottom (visually this is just upside down). Below is my code:
Code:
set SelRng = Selection
Set WghtChrt = ActiveWorkbook.Charts.Add
With WghtChrt
.ChartType = xlLine
.SetSourceData Source:=SelRng
.SeriesCollection(1).Name = "Lower Limit"
.SeriesCollection(2).Name = "Coat Weight"
.SeriesCollection(3).Name = "Upper Limit"
End With
Any help would be appreciated. Bonus points if you can tell me how to make it so it automatically move the legend from the bottom (default) to the top right as well..
Last edited: