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

如题所述

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
温馨提示:答案为网友推荐,仅供参考
相似回答