Macro to print selected pages - doesn't print last page


Posted by Philip on July 26, 2001 6:58 AM

Hey all,
I have a macro that is connected to a button that basically just arrays all the worksheets in the workbook and then prints them all. The code is something like this:
Sub printall()
Sheets(Array("A", "B", "C", "D", "E" Replace:=False
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("A").Select
Range("A2").Select

End Sub

This all works as planned except for some reason, it won't print the worksheet called "E" (not really its name, just listed here for simplicity). If I add a sheet, "F" to the workbook and add the code for "F" in the macro, it now will print A-E but not F. If I add 4 more sheets (G-J), it will print everything but J.

Any ideas or suggestions?



Posted by mseyf on July 26, 2001 11:12 AM


you could try:

Sub printall()
Sheets.PrintOut Copies:=1, Collate:=True
Sheets("A").Select
Range("A2").Select
End Sub

HTH

Mark