|
各位大神,为什么VBA设置打印区域后,会有外面的框框呢?怎么去掉?我自己EXCEL是没有设置外框和打印区域的。
这是我的代码:
Private Sub 打印评估报告附表_Click()
' 设置打印区域
Worksheets("应收账款").PageSetup.PrintArea = "$A$2:$J$26"
' 打印标题
Worksheets("应收账款").PageSetup.PrintTitleRows = "$2:$7"
' 页面设置
With Worksheets("应收账款").PageSetup
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.Orientation = xlLandscape
.PaperSize = xlPaperA4
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintGridlines = True
.PrintHeadings = False
End With
' 设置列宽
Worksheets("应收账款").Columns("A:A").ColumnWidth = 5
Worksheets("应收账款").Columns("B:B").ColumnWidth = 20
Worksheets("应收账款").Columns("C:C").ColumnWidth = 10
Range("D:D,E:E").ColumnWidth = 10
Range("F:F,G:G").ColumnWidth = 15
Range("H:H,I:I,J:J").ColumnWidth = 12
' 设置行距
With Range("A2:J26").Rows(2)
.RowHeight = 30
.Font.Size = 12
.Font.Bold = True
End With
Range("A3:J26").Rows.RowHeight = 15
PageSetup.Zoom = 100
Worksheets("应收账款").PrintPreview
End Sub
|
-
如何去掉外面红色标注的框框
|