I have a macro that prints 2 tabs in a workbook, the first is a summary printed in landscape, and the second tab is 15 pages of detail, printed in portrait.
I found some code in the archives that helped me pull up the print dialog box, which works perfectly for allowing the user to choose their printer, and other options.....except when the user cancels the print, it still prints the detail tab!
Is there an easy way for the macro to quit if the user cancels the first print job?.....i could call up the printer dialog box twice, but that would be confusing.
Here's my VBA code:
Sub print_book()'
Sheets("Summary").Select
Application.Dialogs.Item(xlDialogPrint).Show
Sheets("Details").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
Thanks for your help!
I found some code in the archives that helped me pull up the print dialog box, which works perfectly for allowing the user to choose their printer, and other options.....except when the user cancels the print, it still prints the detail tab!
Is there an easy way for the macro to quit if the user cancels the first print job?.....i could call up the printer dialog box twice, but that would be confusing.
Here's my VBA code:
Sub print_book()'
Sheets("Summary").Select
Application.Dialogs.Item(xlDialogPrint).Show
Sheets("Details").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End Sub
Thanks for your help!