+ Reply to Thread
Results 1 to 2 of 2

Thread: Legend Line Spacing

  1. #1
    Bill Sturdevant
    Guest

    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. #2
    Andy Pope
    Guest

    Re: Legend Line Spacing

    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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0