0

问题:我有一个包含大约 250 个图表的大文件,我一直在用如下代码格式化图表=

         With chrt
            .SetSourceData Source:=rChartData.Offset(0, 1).Resize(, 3)

            .SetElement msoElementChartTitleCenteredOverlay
            .ChartTitle.Caption = cl.Value

            .PlotArea.Height = .PlotArea.Height - .ChartTitle.Height
            .PlotArea.Top = .PlotArea.Top + .ChartTitle.Height

            .SeriesCollection(1).Name = "=""Measured"""
            .SeriesCollection(2).Name = "=""Modeled"""

            .SeriesCollection(1).MarkerStyle = -4142
            .SeriesCollection(2).MarkerStyle = -4142
            
            .Axes(xlCategory).MinimumScale = 14650
            .Axes(xlCategory).MaximumScale = 40000
            .Axes(xlCategory).MajorUnit = 1800
            .Axes(xlCategory).MinorUnitIsAuto = True

            .SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
                .Axes(xlCategory).AxisTitle.Text = "Stress Periods"
            .SetElement (msoElementPrimaryValueAxisTitleRotated)
                .Axes(xlValue, xlPrimary).AxisTitle.Text = "Cubic Feet/Sec"
       
       End With

然后它继续它的快乐循环以完成其他 249 个图表。但我还需要它们都大于 Excel 给我的默认大小。将我的图表扩展到更大尺寸(例如从 A 到 B)的正确代码术语是什么?

在此处输入图像描述

4

1 回答 1

0

我找到了要添加到伞形的属性 With 声明:

          .ChartArea.Width = [desired width, IN POINTS, of the object]
于 2012-10-09T17:12:06.693 回答