|
Sub 批量打印()
Application.ScreenUpdating = False
Dim d As Object
Set d = CreateObject("scripting.dictionary")
With ActiveSheet
.AutoFilterMode = False
r = .Cells(Rows.Count, 1).End(xlUp).Row
If r < 2 Then MsgBox "数据表为空!": End
ar = .Range("a1:a" & r)
For i = 2 To UBound(ar)
If Trim(ar(i, 1)) <> "" Then
If IsDate(ar(i, 1)) Then
d(ar(i, 1)) = ""
End If
End If
Next i
For Each k In d.keys
.Range("a1:i" & r).AutoFilter Field:=1, Criteria1:=Array(2, k) ''精确到年0,到月1,到日2, Operator:=xlAnd
.PrintOut
'.PrintPreview
Next k
End With
Set d = Nothing
Application.ScreenUpdating = True
MsgBox "打印完毕!"
End Sub
|
评分
-
1
查看全部评分
-
|