Change default settings for surface chart legend

R

rmellison

I am creating surface charts containing a lot of data and I'm using a colour
scheme imported from another spreadsheet that looks nice and pretty and fades
from dark green up through yellows, oranges and reds towards the higher
values.

It looks great when there are no borders on the legend entries, but this
always appears to be the default setting, and with borders on my chart is
more black lines than pretty colours. Its a real pain to select each of about
20 legend entries in turn and remove the borders, especially as I am creating
lots of charts.

Is there a quick way (macro?) of getting rid of the borders, or a way to
change the default setting???
 
A

Andy Pope

With a little help from the macro recorder.

Sub RemoveSurfaceBorders()

Dim objLE As LegendEntry

Application.ScreenUpdating = False
With ActiveChart
For Each objLE In ActiveChart.Legend.LegendEntries
objLE.LegendKey.Border.LineStyle = xlNone
Next
End With
Application.ScreenUpdating = True

End Sub

Cheers
Andy
 
R

rmellison

Thanks again Andy!

Andy Pope said:
With a little help from the macro recorder.

Sub RemoveSurfaceBorders()

Dim objLE As LegendEntry

Application.ScreenUpdating = False
With ActiveChart
For Each objLE In ActiveChart.Legend.LegendEntries
objLE.LegendKey.Border.LineStyle = xlNone
Next
End With
Application.ScreenUpdating = True

End Sub

Cheers
Andy
 

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