Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bill Sturdevant
 
Posts: n/a
Default Legend Line Spacing

Is there a way in VB to force a legend to display in single line spacing
rather than what appears to be double line spacing?

I am using the following code to control the display of the legend. Is
there a property I can add that will control the line spacing?

ActiveChart.Legend.Select
Selection.AutoScaleFont = False
With Selection.Font
.Name = "Arial"
.FontStyle = "normal"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With

  #2   Report Post  
Andy Pope
 
Posts: n/a
Default

Hi,

The line spacing is determined by Excel. It uses the size of the legend
box, legend text and number of entries to calculate the layout.
Unfortunately nothing useful is exposed in the object model to make
laying out the legend via code consistent.

To manually reduce the line spacing alter the height of the legend box.

Cheers
Andy

Bill Sturdevant wrote:
Is there a way in VB to force a legend to display in single line spacing
rather than what appears to be double line spacing?

I am using the following code to control the display of the legend. Is
there a property I can add that will control the line spacing?

ActiveChart.Legend.Select
Selection.AutoScaleFont = False
With Selection.Font
.Name = "Arial"
.FontStyle = "normal"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
XY Scatter Legend when Edit Individual Markers John Charts and Charting in Excel 6 June 13th 05 03:06 PM
coloring overy other line without doing so line by line gen Excel Worksheet Functions 5 April 1st 05 10:38 PM
double line spacing using excel 2000 Dan Excel Discussion (Misc queries) 8 March 22nd 05 12:33 PM
Bulleting text and spacing down a line in Excel Gord Dibben Excel Discussion (Misc queries) 0 January 24th 05 09:25 PM
Line chart - date line association gone mad! Johannes Czernin Charts and Charting in Excel 5 January 17th 05 08:48 PM


All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"