Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Printing multiple (selected) workbooks

Hello guys,

I was checking the web (and found nothing) for a macro that would allow me
to print multiple workbooks, a bit like with the "right-click/print"
function in MS Explorer. This function has however two drawbacks:
- prints only the first worksheet (and not the total workbook)
- opens the file (so it's slower), and - very often - "unnecessarily" asks
if I want to save the file before closing and opening the next one.

Do you know how should such an 'enhanced' macro look like? Thanks for any
suggestions.
Regards,

Mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Printing multiple (selected) workbooks

Mark,

Sub PrintAllSheetsInUserSelectedFiles()
Dim FileArray As Variant
Dim myBook As Workbook
Dim mySht As Worksheet

FileArray = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(FileArray) Then
For i = LBound(FileArray) To UBound(FileArray)
Workbooks.Open FileArray(i)
Set myBook = ActiveWorkbook
For Each mySht In myBook.Worksheets
mySht.PrintOut
Next mySht
myBook.Close False
Next i
End If
End Sub

HTH,
Bernie
MS Excel MVP


"markx" wrote in message
...
Hello guys,

I was checking the web (and found nothing) for a macro that would allow me to print multiple
workbooks, a bit like with the "right-click/print" function in MS Explorer. This function has
however two drawbacks:
- prints only the first worksheet (and not the total workbook)
- opens the file (so it's slower), and - very often - "unnecessarily" asks if I want to save the
file before closing and opening the next one.

Do you know how should such an 'enhanced' macro look like? Thanks for any suggestions.
Regards,

Mark



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print selected worksheets in multiple workbooks? T & I Forms Excel Discussion (Misc queries) 1 April 3rd 10 11:52 PM
Printing several selected workbooks in color Maxpayn Excel Discussion (Misc queries) 1 September 15th 09 05:56 PM
printing multiple selected rows peyman Excel Discussion (Misc queries) 13 August 14th 07 09:56 PM
copy selected tabs from multiple workbooks to a new workbook chris Excel Worksheet Functions 0 July 12th 07 03:46 PM
Multiple pages after printing selected area Lynn Excel Discussion (Misc queries) 1 April 17th 06 04:28 PM


All times are GMT +1. The time now is 05:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"