excel如何调整绘图区大小
发布网友
发布时间:2022-04-28 11:30
我来回答
共2个回答
热心网友
时间:2023-10-05 12:54
楼主可以研究一下我的做法:
打开菜单“工具”---“宏”---“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
热心网友
时间:2023-10-05 12:54
可以把所有的绘图区选中之后,在菜单中选“格式”-“自选图形”-“大小”的高度,宽度中设置!
热心网友
时间:2023-10-05 12:54
楼主可以研究一下我的做法:
打开菜单“工具”---“宏”---“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
热心网友
时间:2023-10-05 12:54
可以把所有的绘图区选中之后,在菜单中选“格式”-“自选图形”-“大小”的高度,宽度中设置!