Sub a()
Dim r, c, n, i, x, rng
'页面设置
With Worksheets("Sheet1").PageSetup
.Orientation = xlLandscape '横向模式。
' .Orientation = xlPortrait '纵向模式。
.LeftMargin = Application.InchesToPoints(1)
.RightMargin = Application.InchesToPoints(1)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
End With
'打印区范围从A1起的r行c列
c = 18: r = 48
x = Range("a65536").End(xlUp).Row
n = Int(x / r) + 1
Set rng = Range("A1")
'打印
For i = 1 To n
Set rng = rng.Resize(r, c)
rng.PrintOut
Set rng = rng.Offset(r, 0)
Next i
End Sub