MACRO TO COUNT ALL OPEN WORKBOOKS and print

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.
 
P

Per Jessen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top