2012-10-09 51 views
0

問題:我已經得到了約含250圖表,我已經格式化的代碼看起來像這樣的圖表大文件=Excel的VBA:如何選擇我的所有圖表和改變自己的大小以不同的,但大小均勻?

  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)的正確代碼術語是什麼?

enter image description here

+1

可以嘗試chrt.Parent.Width = someValue中? – Larry

回答

0

我找到屬性添加到傘聲明:

  .ChartArea.Width = [desired width, IN POINTS, of the object] 
相關問題