close

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???

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

rmellison wrote:
gt; I am creating surface charts containing a lot of data and I'm using a colour
gt; scheme imported from another spreadsheet that looks nice and pretty and fades
gt; from dark green up through yellows, oranges and reds towards the higher
gt; values.
gt;
gt; It looks great when there are no borders on the legend entries, but this
gt; always appears to be the default setting, and with borders on my chart is
gt; more black lines than pretty colours. Its a real pain to select each of about
gt; 20 legend entries in turn and remove the borders, especially as I am creating
gt; lots of charts.
gt;
gt; Is there a quick way (macro?) of getting rid of the borders, or a way to
gt; change the default setting???

--

Andy Pope, Microsoft MVP - Excel
www.andypope.info

Thanks again Andy!

quot;Andy Popequot; wrote:

gt; With a little help from the macro recorder.
gt;
gt; Sub RemoveSurfaceBorders()
gt;
gt; Dim objLE As LegendEntry
gt;
gt; Application.ScreenUpdating = False
gt; With ActiveChart
gt; For Each objLE In ActiveChart.Legend.LegendEntries
gt; objLE.LegendKey.Border.LineStyle = xlNone
gt; Next
gt; End With
gt; Application.ScreenUpdating = True
gt;
gt; End Sub
gt;
gt; Cheers
gt; Andy
gt;
gt; rmellison wrote:
gt; gt; I am creating surface charts containing a lot of data and I'm using a colour
gt; gt; scheme imported from another spreadsheet that looks nice and pretty and fades
gt; gt; from dark green up through yellows, oranges and reds towards the higher
gt; gt; values.
gt; gt;
gt; gt; It looks great when there are no borders on the legend entries, but this
gt; gt; always appears to be the default setting, and with borders on my chart is
gt; gt; more black lines than pretty colours. Its a real pain to select each of about
gt; gt; 20 legend entries in turn and remove the borders, especially as I am creating
gt; gt; lots of charts.
gt; gt;
gt; gt; Is there a quick way (macro?) of getting rid of the borders, or a way to
gt; gt; change the default setting???
gt;
gt; --
gt;
gt; Andy Pope, Microsoft MVP - Excel
gt; www.andypope.info
gt;

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()