LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to capture the Print button event

Hello,
I created an application with several sheets:
- Sheet1 is a form with a lot of dropdown lists.
- Sheet2, named "Impression", is the document to be printed with all the
values selected in Sheet1
Sheet 2 is hidden

What I want to do is to capture the Print event, so that the VBA macro print
the document in Sheet2, but nothing else. In fact, my macro prints both
sheets...

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Worksheets("Impression").PageSetup.PrintArea = "$A$1:$H$49"
Worksheets("Impression").PrintOut Copies:=1, Collate:=True
Cancel = False
End Sub

If I set Cancel = True, nothing is printed !

How can I do that ?
Thanks for your help.


 
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
capture link update event xk Excel Programming 0 December 9th 06 06:10 PM
Stop Capture Event OverAC[_19_] Excel Programming 4 April 11th 06 02:08 PM
Any way to capture an Autofilter event? mrwaller Excel Programming 1 January 20th 06 06:15 PM
capture right mouse button click event on cell Reinhard Thomann Excel Programming 0 January 20th 05 11:41 AM
Capture scrolling event Allen[_12_] Excel Programming 2 April 22nd 04 03:37 AM


All times are GMT +1. The time now is 12:18 AM.

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"