|
有如下几个要求:
1、A3竖向
2、双面
3、黑白打印
4、所有列打印在一页
尝试着用宏录了几次,以下是语句
有三个问题哦:
1、怎样打印整个工作簿?
2、怎么控制所有工作表的打印区域?
3、怎么调整打印出来每张表都符合上面4个要求?
我自己尝试打印了活动工作表,做了备注
Sub 宏5()
'
' 宏5 宏
'
'
ActiveWindow.SmallScroll Down:=-9
Application.PrintCommunication = False
With ActiveSheet.PageSetup '打印
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = "$A$1:$E$16" '打印顶端行标题
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.707638888888889)
.RightMargin = Application.InchesToPoints(0.707638888888889)
.TopMargin = Application.InchesToPoints(0.747916666666667)
.BottomMargin = Application.InchesToPoints(0.747916666666667)
.HeaderMargin = Application.InchesToPoints(0.313888888888889)
.FooterMargin = Application.InchesToPoints(0.313888888888889)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA3 '使用A3打印纸
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False '黑白打印??
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = False
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Sheets("财务管理部 ").Select
End Sub
|
|