当前位置: 动力学知识库 > 问答 > 编程问答 >

vba - How high are the Legend-Entries in a Excel Chart?

问题描述:

I know this sounds stupid, but I need to know the actual height of a single Legend-Entry.

Why:

In my chart the height changes, depending on the Legend-Entries on the right side of the chart.

VBA code:

1 countLegend = ActiveChart.Legend.LegendEntries.Count

2 If countLegend > 13 Then

3 ActiveChart.Parent.Height = 325 + 10 * (countLegend - 13)

4 Else

5 ActiveChart.Parent.Height = 325

6 End If

The "10" at line 3 is the current solution, but if I add too many Legend-Entries there would be a big space above and underneath...

I hope someone can help me with this problem...

Thank you very much in advance for your answers...

分享给朋友:
您可能感兴趣的文章:
随机阅读: