MACRO TO COUNT ALL OPEN WORKBOOKS and print

  • Thread starter Thread starter JOSEPH WEBER
  • Start date Start date
J

JOSEPH WEBER

I need to know if there is a way i can run a macro to count all open
workbooks and print "sheet1" of all open workbooks. The macro should close
each workbook after printing the first sheet.
 
Hi

Here's a way

Sub aaa()
For Each wb In Application.Workbooks
wb.Sheets("Sheet1").PrintOut
wb.Close savechanges:=True 'Or false
counter = counter + 1
Next
msg = MsgBox(counter & " sheets has been printed", vbInformation + vbOKOnly)
End Sub

Regards,
Per
 
Back
Top