LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 98
Default Question with existing print macro

Hi I use the following macro below to print only desired sheets,


Sub PrintButton_Click()

'to start stop screen updating (stops screen flicker)
Application.ScreenUpdating = False

Sheets("Cover").Select
Application.Dialogs(xlDialogPrint).Show

Sheets("sheet2").Select
If Range("Calcs!i1") = True Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End If

Sheets("sheet3").Select
If Range("Calcs!f1") = True Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1
End If

'etc etc

End sub


This works as required!

This macro is linked to a control button, when pressed the user sees the
standard excel print screen where they can select their printer, and then
print, no problems. If however the user decides for some reason to then press
the cancel button, I you get a run error, I was wondering if it would be
possible such if they press cancel, it goes back to the sheet called cover
instead of getting the run error?
--
This post was created using recycled electrons!
 
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
Macro Help (Uppercase multiple ranges?) Ken Excel Discussion (Misc queries) 14 December 2nd 06 07:23 PM
Macro question Chris Excel Worksheet Functions 12 July 7th 06 01:23 AM
Error using a macro to print multiple pages. [email protected] Excel Discussion (Misc queries) 2 June 21st 06 06:47 AM
Macro question punter Excel Discussion (Misc queries) 10 June 12th 06 11:15 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM


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

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

About Us

"It's about Microsoft Excel"