|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub test()
For Each sht In Worksheets
If sht.Name <> "打印表" Then
With sht
num = WorksheetFunction.CountIf(.[j:j], "Y")
ReDim AR(1 To num, 1 To 10)
arr = .Range("a1:j" & .Cells(Rows.Count, 1).End(xlUp).Row)
For i = 1 To UBound(arr)
If arr(i, 10) = "Y" Then
N = N + 1
For II = 1 To 10
AR(N, II) = arr(i, II)
Next
End If
Next
End With
Sheets.Add.Name = "打印表"
Sheets("打印表").UsedRange.ClearContents
Sheets("打印表").[A1].Resize(UBound(AR), 10) = AR
Sheets("打印表").PrintOut
End If
Next
End Sub
可以用循环来批量打印所有工作表 |
评分
-
1
查看全部评分
-
|