我有一個工作表,用於選擇所有已編輯並打印它們的單元格。我已經將打印選項設置爲適合1頁,但是當我開始打印超過50行時,它變得很小。這裏是我當前的代碼每頁僅打印50行
Dim R As Integer
On Error GoTo 1
R = Range("A65536").End(xlUp).Row
Worksheets("ACM").Range("E1").Font.Color = vbBlack
ActiveSheet.Range(Cells(1, 1), Cells(R, 5)).Select
ActiveSheet.PageSetup.PrintArea = Selection.Address
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.Orientation = xlPortrait
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
我嘗試添加 ActiveSheet.HPageBreaks.Add.Cell(「A51」) ,使其打印每頁只有50行,但此行的錯誤了。
所以問題:有沒有辦法讓它,所以我只打印50行1頁?第二個問題是我可以在第二頁上打印標題嗎?
你在什麼版本的Excel? – ExactaBox
我正在使用Excel 2010 – user3271518