ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print with sevral different print area's (https://www.excelbanter.com/excel-programming/435105-print-sevral-different-print-areas.html)

Vsn

Print with sevral different print area's
 
Hi all,

I wonder would it be possible to printpreview several different print area's
after using the [Print Preview] command from the menu without always
phisicaly printing the second preview after closing [Close] it on the menu?

I now get the first area previewed, close it, get the second area previewed,
close it and than always physicaly prints no matter I press [CLOSE]

I have code like this:-

Private Sub Workbook_BeforePrint(Cancel As Boolean)
'First print area
ActiveSheet.PageSetup.PrintArea = "$D$9:$I$25"
ActiveWindow.SelectedSheets.PrintPreview

'Second print area
ActiveSheet.PageSetup.PrintArea = "$A$1:$D$20"
ActiveWindow.SelectedSheets.PrintPreview
End Sub




Thx,
Ludovic



Don Guillett

Print with sevral different print area's
 
Try this idea
Sub printpreview()
Range("a1:b20").printpreview
If InputBox("do you want other") = OK _
Then Range("l1:m20").printpreview
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Vsn" <vsn_hotmail_kom wrote in message
...
Hi all,

I wonder would it be possible to printpreview several different print
area's after using the [Print Preview] command from the menu without
always phisicaly printing the second preview after closing [Close] it on
the menu?

I now get the first area previewed, close it, get the second area
previewed, close it and than always physicaly prints no matter I press
[CLOSE]

I have code like this:-

Private Sub Workbook_BeforePrint(Cancel As Boolean)
'First print area
ActiveSheet.PageSetup.PrintArea = "$D$9:$I$25"
ActiveWindow.SelectedSheets.PrintPreview

'Second print area
ActiveSheet.PageSetup.PrintArea = "$A$1:$D$20"
ActiveWindow.SelectedSheets.PrintPreview
End Sub




Thx,
Ludovic



Vsn

Print with sevral different print area's
 
Don,

I put it like this (below) and get an error PrintPreview methode of Range
class failed........?

Private Sub Workbook_BeforePrint(Cancel As Boolean)
PPV
End Sub


Sub PPV()
Range("a1:b20").printpreview
If InputBox("do you want other") = OK _
Then Range("d20:m20").printpreview
End Sub

Did I implement something wrong?


Cheers,
Ludovic

"Don Guillett" schreef in bericht
...
Try this idea
Sub printpreview()
Range("a1:b20").printpreview
If InputBox("do you want other") = OK _
Then Range("l1:m20").printpreview
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Vsn" <vsn_hotmail_kom wrote in message
...
Hi all,

I wonder would it be possible to printpreview several different print
area's after using the [Print Preview] command from the menu without
always phisicaly printing the second preview after closing [Close] it on
the menu?

I now get the first area previewed, close it, get the second area
previewed, close it and than always physicaly prints no matter I press
[CLOSE]

I have code like this:-

Private Sub Workbook_BeforePrint(Cancel As Boolean)
'First print area
ActiveSheet.PageSetup.PrintArea = "$D$9:$I$25"
ActiveWindow.SelectedSheets.PrintPreview

'Second print area
ActiveSheet.PageSetup.PrintArea = "$A$1:$D$20"
ActiveWindow.SelectedSheets.PrintPreview
End Sub




Thx,
Ludovic






All times are GMT +1. The time now is 04:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com