Writing a Procedure to print non-contagious area on the smae page

  • Thread starter Basharat A. Javaid
  • Start date
B

Basharat A. Javaid

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.
 
A

Andrew B

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
 
T

Tom Ogilvy

Sheets("Sheet1").Select
Range("A9:A57").EntireRow.Hidden = True
Range("A4:I66")).PrintOut Copies:=1, Collate:=True
Range("A9:A57").EntireRow.Hidden = False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top