View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JLatham JLatham is offline
external usenet poster
 
Posts: 3,365
Default print 2 worksheets from print button?

Yes, you can do much of what you have asked regarding a custom button.

Here's what a lot of people, including myself, do with such special things
instead of creating a custom toolbar icon or adding a new menu item:

Start by recording a macro while selecting and printing the two pages.
Use View | Toolbars and bring the Forms toolbar into view. Choose the
command button from that menu and draw one on one of the sheets. Once it's
drawn it will bring up an "Assign Macro?" dialog and offer a default macro
name, don't use that, click on the name of the one you recorded. Edit the
label on the button. You're done!

If you want something a little more colorful, you can use a shape from the
Drawing toolbar in that same fashion: once you've drawn it on the sheet and
added text to it, right-click it and choose Assign Macro and choose the
appropriate macro.

If you do either of these, be sure and remove the Workbook_BeforePrint()
code that we gave you earlier.

"fedude" wrote:

J,

Bingo. This worked fine. As you and Don suggested, intercepting the
Workbook_BeforePrint event accomplishes exactly what I asked for Thank You!.

You raise a couple of good points.

Maybe a better solution would be to create another custom button for the
toolbar that when pressed prints out the two ranges from the 2 sheets in
question. Is this even possible?

Or is there another way to idiot-proof the printing operation