|
发表于 2016-12-21 16:02
|
显示全部楼层
本楼为最佳答案
- Sub 页面设置3()
- 'tt = Timer
- Dim sh As Worksheet
- Application.PrintCommunication = False
- For Each sh In Worksheets
- If sh.Name Like "*班" Then x = x & "," & sh.Name
- Next
- x = Mid(x, 2)
- If InStr(x, ",") > 0 Then Sheets(Split(x, ",")).Select Else If Len(x) > 0 Then Sheets(x).Select
- Sheets(Split(x, ",")(0)).Activate
- With ActiveSheet.PageSetup
- .Orientation = xlLandscape '纸张横向'
- .Orientation = xlPortrait '纸张纵向'
- .PaperSize = xlPaperA4
- .LeftMargin = Application.CentimetersToPoints(0.1)
- .RightMargin = Application.CentimetersToPoints(0.1)
- .TopMargin = Application.CentimetersToPoints(1)
- .BottomMargin = Application.CentimetersToPoints(1)
- .HeaderMargin = Application.CentimetersToPoints(1)
- .FooterMargin = Application.CentimetersToPoints(0.5)
- .BlackAndWhite = True '单色打印
- .PrintTitleRows = "$1:$2" '设置“顶端标题行”
- .CenterHorizontally = True '水平居中
- .LeftFooter = "第 &P 页,共 &N 页"
- End With
- Application.PrintCommunication = True
- 'MsgBox Timer - tt
- End Sub
复制代码 |
评分
-
查看全部评分
|