I have a bunch of charts that I need to plot voltage and current measurments on primay and secondary axis respectivly.
Is there anyway to do this when I create the chart? Each chart will have four different series on the primary axis and eight on the secondary.
The problem I have is when creating the chart everything gets put on the primary axis. when I select a data set and place it on the secondary axis Excel automatically adds markers to the line. Now I have to go it and remove the markers.
This just creates more work for me.
Is there any way to place a data set on the secondary axis without Excel adding markers or doing anything else I did not ask for?
what excel are you using?
In xl2003 I just create a multiple line chart with mixed marker and non marker lines. Moving axis did not alter the line style, colour or marker.
I am using Excel 2003-SP3
I have included an example. Chart 1 is the defalut line chart output Chart 2 is the same defaults as Chart 1 but I placed the second series (Line 2) on a secondary axis.
Notice that Excel changed the line style to a line with markers.
Now on a chart with only two series its no bit deal, but larger charts with more data points in each series that are close in value this becomes a real P.I.A. to go back and reformat every line that Excel changes.
Well what do know. Never notied that before.
Here is some code to sort out the lines on the secondary axis
Sub X() Dim objSeries As Series With ActiveChart For Each objSeries In .SeriesCollection If objSeries.AxisGroup = xlSecondary Then objSeries.MarkerStyle = xlMarkerStyleNone End If Next End With End Sub
Thanks!
Now how do I use that code?
You need to add it to a module. Either in a new workbook or the one with the charts.
Go to VBE (ALT+F11)
Insert Module
Paste code.
To use select a chart and then run code.
If you have many charts then you would need to add some more code to loop through all the charts and or chartobjects. There are examples of this on the forum but if you get stuck post back.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks