Thread: Before_Print
View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
JMay JMay is offline
external usenet poster
 
Posts: 422
Default Before_Print

Also...
I am triggering this Before_Print event by clicking on the Toolbar
Button PRINT-PREVIEW (if that matters).
Jim


"JMay" wrote in message
:

Bob, thanks -- but here is my code:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim lrow As Long
Dim rng As Range
lrow = Range("B65536").End(xlUp).Row
Set rng = Range("A5:C" & lrow)
With ActiveSheet
.PageSetup.PrintArea = rng.Address
.PrintPreview
End With
End Sub

It seems that I need an additional statement above, because when
I click on the Close button which appears on the Preview Screen
My Printer takes-off printing the 40 (unwanted) sheets, grrrrrr..




"Bob Phillips" wrote in message
:

Why not just use the Print Preview toolbar button?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"JMay" wrote in message
...
Often I only want to Print Preview a Doc
What is necessary in the Before_Print Code
So that when I click on the Close button in the Print-Preview screen.
I am returned to my worksheet INSTEAD of the printer cranking
Up and beginning to print my umpteen pages UNNECESSARILY.

Thanks,