Printing multiple ranges on 1 page

bademployee

Board Regular
Joined
Aug 19, 2010
Messages
184
I'm using a simple print preview:

Code:
Private Sub CommandButton5_Click()
    With ActiveSheet
        .PageSetup.PrintArea = "$b$1:$t$5"
        .PageSetup.Orientation = xlLandscape
        .PageSetup.Zoom = 85
        .PrintPreview
End With
End Sub

But want to add $b$27:$t$45 as well on the same page - is this possible?

Thanks
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I believe you should set the print area to print one single range and hide the rows you don't want to print:
Code:
Dim HiddenRng As Range

With ActiveSheet


    Set HiddenRng = .Range("A6:A26")


    HiddenRng.EntireRow.Hidden = True


        With .PageSetup
            .PrintArea = "$b$1:$t$45"
            .Orientation = xlLandscape
            .FitToPagesWide = 1
            .FitToPagesTall = 1
            .Zoom = 85
        End With
    
    .PrintPreview


    HiddenRng.EntireRow.Hidden = False


End With

If the hidden range is always the same you might want to set is as a constant and just make sure it's hidden when you print the sheet.
 
Upvote 0

Forum statistics

Threads
1,214,817
Messages
6,121,720
Members
449,050
Latest member
MiguekHeka

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top