|
Sub 打印()
Application.ScreenUpdating = False
Dim rn As Range
Dim ws As Worksheet
Set ws = ActiveSheet
With ws
.Unprotect password:="123" '
lastRow = ws.Cells.Find("*", searchdirection:=xlPrevious).Row
.Rows("7:" & lastRow).EntireRow.Hidden = False
For i = 7 To lastRow
sl = Application.CountA(.Range(.Cells(i, 2), .Cells(i, 18)))
If sl = 0 Then
If rn Is Nothing Then
Set rn = .Rows(i)
Else
Set rn = Union(rn, .Rows(i))
End If
End If
Next i
If Not rn Is Nothing Then rn.EntireRow.Hidden = True
.PrintOut
.Protect password:="123"
End With
Set rn = Nothing
Application.ScreenUpdating = True
MsgBox "ok!"
End Sub
|
评分
-
1
查看全部评分
-
|