|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub my_print()
Dim myPrintArea$, theCell As Range
'
With ActiveSheet
With .Columns("A:G")
Set theCell = .Find("*", .Cells(1), xlValues, xlPart, xlByRows, xlPrevious, False, False, False)
End With
If Not theCell Is Nothing Then
myPrintArea = .Range(.Cells(1, 1), .Cells(theCell.Row, 7)).Address(ReferenceStyle:=xlA1)
With .PageSetup
.BlackAndWhite = True
.PrintArea = myPrintArea
End With
.PrintPreview '预览打印
' .PrintOut '打印
End If
End With
Set theCell = Nothing
End Sub |
评分
-
1
查看全部评分
-
|