Sub outs()
Dim files, printhit, printfile, opsheets
files = Application.WorksheetFunction.Max(Range("A:A"))
For i = 1 To files
If Cells(i + 3, 3) <> 0 Then
printhit = Cells(i + 3, 3)
printfile = Cells(i + 3, 2)
Workbooks.Open Filename:=Cells(1, 2) & "\" & Cells(i + 3, 2)
opsheets = Application.Worksheets.Count '获取工作薄中有多少个表
For x = 1 To opsheets
For j = 1 To printhit
Sheets(x).Visible = xlSheetVisible
Sheets(x).Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Next
Next
Workbooks(printfile).Close SaveChanges:=False
End If
Next
End Sub (, 下载次数: 3)