XY marker change for entire workbook

G

Guest

Is there a way to change the markers for data series across several charts
within a workbook? I have been given A LOT of charts to make consistent and
was wondering is there is a way to apply a certain marker style to an entire
data series across several charts. Each chart is made from one data sheet in
the workbook, but placed on a separate page within the workbook.
 
J

Jon Peltier

You would need to use a macro to loop through the charts, changing the
markers. For example

Sub ChangeMarkers()
Dim cht As Chart
Dim srs As Series
For Each cht In ActiveWorkbook.Charts
For Each srs In cht.SeriesCollection
Select Case srs.Name
' add cases and marker info here based on series name
Case "Alpha"
srs.MarkerStyle = xlMarkerStyleSquare
srs.MarkerBackgroundColorIndex = 3
srs.MarkerForegroundColorIndex = 3
Case "Beta"
srs.MarkerStyle = xlMarkerStyleTriangle
srs.MarkerBackgroundColorIndex = 5
srs.MarkerForegroundColorIndex = 5
End Select
Next
Next
End Sub

- Jon
 
G

Guest

YIKES!
thank you for the information.

Jon Peltier said:
You would need to use a macro to loop through the charts, changing the
markers. For example

Sub ChangeMarkers()
Dim cht As Chart
Dim srs As Series
For Each cht In ActiveWorkbook.Charts
For Each srs In cht.SeriesCollection
Select Case srs.Name
' add cases and marker info here based on series name
Case "Alpha"
srs.MarkerStyle = xlMarkerStyleSquare
srs.MarkerBackgroundColorIndex = 3
srs.MarkerForegroundColorIndex = 3
Case "Beta"
srs.MarkerStyle = xlMarkerStyleTriangle
srs.MarkerBackgroundColorIndex = 5
srs.MarkerForegroundColorIndex = 5
End Select
Next
Next
End Sub

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top