Thread: excel printing
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default excel printing

Create a new workbook to help with this process. In that new workbook, press
[Alt]+[F11] to open the Visual Basic Editor and while in it, use Insert |
Module to create an empty code module. Copy the code below and paste it into
that module and save the workbook with an easy to remember name, perhaps like
PrintAllInvoices.xls.

Sub PrintThemAll()
Dim anyBook As Workbook
For Each anyBook In Application.Workbooks
If anyBook.Name < ThisWorkbook.Name Then
anyBook.Sheets(1).PrintOut copies:=1
End If
Next
End Sub

To use it, do as you'd said you wanted to: highlight all the ones you want
to print out and Open them - once they're all open, open up the 'special'
workbook and use Tools | Macro | Macros to run the PrintThemAll macro. You
could even modify the code some, as below, to close each one after it's been
printed:

Sub PrintThemAll()
Dim anyBook As Workbook
For Each anyBook In Application.Workbooks
If anyBook.Name < ThisWorkbook.Name Then
anyBook.Sheets(1).PrintOut copies:=1
Application.DisplayAlerts = False
anyBook.Close
Application.DisplayAlerts = True
End If
Next
End Sub


"Duke" wrote:

I have one invoice per file saved in my excel / office 2003. I need to print
all 100 of these files. How can I print all at once. Right now all I know
how to do is print one at a time by opening up just that one and then
printing it. I would like to highlight all one hundred in the "open file"
widow and then hit print.
--
GDL