[英]Excel VBA: How can I select all of my Charts and change their sizes to a different, yet uniform size?
The problem: I've got a large file containing about 250 charts, I've been formatting the charts with code looking like this= 问题:我有一个大文件,其中包含约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
Then it goes on its merry loop to finish the other 249 charts. 然后它继续前进,完成其他249张图表。 But I also need all of them to be larger than the default size Excel gives me.
但是我还需要所有这些都大于Excel给我的默认大小。 What is the correct code terminology to extend my chart to a larger size such as this from A to B?
什么是将我的图表扩展到更大的尺寸(例如,从A到B)的正确代码术语?
我找到了要添加到伞式With语句的属性:
.ChartArea.Width = [desired width, IN POINTS, of the object]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.