change point size of all points in an xy chart

K

kilter

I have 255 series in an xy chart and would like to reduce the point
size to 2. Could some kind soul give me a hand with a vba script to do
this (I have not programmed in vba before). Any help very gratefully
received.
 
A

Andy Pope

Hi,

This should do it. Just select the chart before running.

Paste into a standard code module.

Sub ReducePointSize()

Dim serX As Series

For Each serX In ActiveChart.SeriesCollection
If serX.MarkerSize - 2 > 1 Then
serX.MarkerSize = serX.MarkerSize - 2
End If
Next

End Sub

Cheers
Andy
 
J

Jon Peltier

Marker size?

Select the chart and run this macro. You'll probably change your mind about
the size of 2, so it asks what size you want when it runs, with a default of
2. It also makes sure you've selected a chart first.

Sub ChangeMarkerSize()
Dim srs As Series
Dim newsize As Long
If ActiveChart Is Nothing Then
MsgBox "Select a chart and try again."
Else
newsize = Application.InputBox("What size for your markers?", _
"Enter Marker Size", 2, , , , , 1)
If newsize < 2 Then newsize = 2
If newsize > 72 Then newsize = 72
For Each srs In ActiveChart.SeriesCollection
On Error Resume Next
srs.MarkerSize = newsize
On Error GoTo 0
Next
End If
End Sub

- Jon
 

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