ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Writing a Procedure to print non-contagious area on the smae page (https://www.excelbanter.com/excel-programming/333597-writing-procedure-print-non-contagious-area-smae-page.html)

Basharat A. Javaid

Writing a Procedure to print non-contagious area on the smae page
 
I want to write a procedure to print non-contagious print areas on the same
page. For example, I want to print range A1:I8 and range A58:I66 on the
same page.

I tried the following
......
Sheets("Sheet1").Select
Union(Range("A4:I8"), Range("A58:I66")).Select
Selection.PrintOut Copies:=1, Collate:=True

but the two ranges are printed on two pages.


Regards


Basharat.



Andrew B[_4_]

Writing a Procedure to print non-contagious area on the smaepage
 
Hi
I think your best solution here is to copy the ranges to another
worksheet first and then print that sheet. Something like this:


Sub PrintRanges()
Set Sh1 = Sheets(1)
Set Shp = Sheets("PrRanges") 'Printout sheet
Shp.Range("A4:U66") = "" 'Clear area first
Shp.Range("A4:I8") = Sh1.Range("A4:I8").Value 'copy 1st range
Shp.Range("K4:S12") = Sh1.Range("A58:I66").Value 'copy 2nd range
Shp.PrintOut From:=1, To:=1, copies:=1
End Sub

Shp.Range("K4:S12") could be Shp.Range("A10:I18"), depends where you
want the second range to be in relation to the first range.


HTH

Andrew Bourke

Basharat A. Javaid wrote:
I want to write a procedure to print non-contagious print areas on the same
page. For example, I want to print range A1:I8 and range A58:I66 on the
same page.

I tried the following
.....
Sheets("Sheet1").Select
Union(Range("A4:I8"), Range("A58:I66")).Select
Selection.PrintOut Copies:=1, Collate:=True

but the two ranges are printed on two pages.


Regards


Basharat.



Tom Ogilvy

Writing a Procedure to print non-contagious area on the smae page
 
Sheets("Sheet1").Select
Range("A9:A57").EntireRow.Hidden = True
Range("A4:I66")).PrintOut Copies:=1, Collate:=True
Range("A9:A57").EntireRow.Hidden = False

--
Regards,
Tom Ogilvy


"Basharat A. Javaid" wrote in message
...
I want to write a procedure to print non-contagious print areas on the

same
page. For example, I want to print range A1:I8 and range A58:I66 on the
same page.

I tried the following
.....
Sheets("Sheet1").Select
Union(Range("A4:I8"), Range("A58:I66")).Select
Selection.PrintOut Copies:=1, Collate:=True

but the two ranges are printed on two pages.


Regards


Basharat.






All times are GMT +1. The time now is 06:49 AM.

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