Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Print selected worksheets in multiple workbooks? | Excel Discussion (Misc queries) | |||
Printing several selected workbooks in color | Excel Discussion (Misc queries) | |||
printing multiple selected rows | Excel Discussion (Misc queries) | |||
copy selected tabs from multiple workbooks to a new workbook | Excel Worksheet Functions | |||
Multiple pages after printing selected area | Excel Discussion (Misc queries) |