excel里多张图表绘图区调为一样大?

2024-12-03 00:42:41
推荐回答(2个)
回答1:

1楼的操作也可以实现调整大小,但是相关格式没法调整。

楼主可以研究一下我的做法:
打开菜单“工具”---“宏”---“VB编辑器”,双击所在sheet表,把以下代码粘贴进去,保存。

然后按shift键,选定你所有的图表,打开菜单“工具”---“宏”---“宏”---选择“调整图表大小”---“执行”宏

具体的图表你还可以调节代码去调整长宽、字体格式等元素。

Sub 调整图片大小()
Selection.ShapeRange.Height = 150
Selection.ShapeRange.Width = 240
End Sub
Sub 调整图表区格式()
With Selection.Border
.Weight = 2
.LineStyle = 0
End With
Selection.Interior.ColorIndex = xlAutomatic
Selection.AutoScaleFont = False
With Selection.Font
.Name = "宋体"
.FontStyle = "常规"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.PlotArea.Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Interior.ColorIndex = xlNone
ActiveChart.Legend.Select
With Selection.Border
.Weight = xlHairline
.LineStyle = xlNone
End With
Selection.Shadow = False
Selection.Interior.ColorIndex = xlNone

End Sub
Sub 调整单轴绘图区()
ActiveChart.PlotArea.Select
Selection.Top = 7
Selection.Width = 205
Selection.Height = 115
Selection.Left = 15
End Sub
Sub 调整双轴绘图区()
ActiveChart.PlotArea.Select
Selection.Top = 7
Selection.Width = 195
Selection.Height = 115
Selection.Left = 15
End Sub
Sub 复制图像()'偷懒,不用按shift键了
ActiveChart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, Format:= _
xlPicture
End Sub

回答2:

可以把所有的绘图区选中之后,在菜单中选“格式”-“自选图形”-“大小”的高度,宽度中设置!