Excel VBA 页面设置

2024-10-14 07:07:28

1、打开新建一个并打开EXCEL工作表

Excel VBA 页面设置Excel VBA 页面设置

4、如果我们想直接设置厘米单位,我们这一将代码改为如下:Sub 初始化设置() ActiveSheet.Cells.RowHeight = 16 ActiveSheet.Cells.ColumnWidth = 9 With ActiveSheet.PageSetup .LeftMargin = Application.CentimetersToPoints(0.5) .RightMargin = Application.CentimetersToPoints(0.5) .TopMargin = Application.CentimetersToPoints(1.5) .BottomMargin = Application.CentimetersToPoints(1) '底 .HeaderMargin = Application.CentimetersToPoints(0.5) '页眉 .FooterMargin = Application.CentimetersToPoints(0.5) '页脚 .Zoom = 100 End WithEnd Sub

Excel VBA 页面设置
猜你喜欢