Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Posts
    1,418
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Different Page Layouts For Multi-page Worksheet

    Does anyone know of a way to print different page layouts from data on a multi-page worksheet? That is, if I have a worksheet that consists of several pages, can I print the first page in landscape, the second in portrait, and the third in landscape again?
    Thanks in advance.
    Jeff

  2. #2
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Different Page Layouts For Multi-page Worksheet

    Using VBA, check out .Pagesetup.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Posts
    1,418
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Different Page Layouts For Multi-page Worksheet

    Thanks, Michael, but I am not familiar with using VBA. How do I do it?
    Thanks,
    Jeff

  4. #4
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Different Page Layouts For Multi-page Worksheet

    Hi Jeff,

    Try the following code attached to a button, or whatever other method you would like to use to run it:

    <pre>Private Sub PS()
    With Sheets("YourSheetHere").PageSetup
    .PrintGridlines = False
    .Orientation = xlLandscape
    .Draft = False
    .BottomMargin = 70
    .LeftMargin = 36
    .LeftFooter = "YourOwnFooterHere-CanBeReferenceIfUWant"
    .CenterFooter = "Printed on " & Date & " at " & Time
    .RightFooter = " Page " & "&P"
    .PrintTitleRows = ActiveSheet.Rows("1:5").Address
    End With
    Range("a1:cr218").Select
    Selection.PrintOut copies:=1
    End Sub
    </pre>


    You might have to change the range you want printed, or the .PrintTitleRows to suit your needs. There is probably a better way to do this, as you would have to change the orientation for each of the different ranges you wish to print, but maybe this will get you started.

    You can get to the VB Editor through "Tools/Macro/Visual Basic Editor".

    Thanks,

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia, Australia
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Different Page Layouts For Multi-page Worksheet

    Page Setup (File menu)can be set for each individual sheet in a workbook, there is no problem in setting some sheets to portrait and others to landscape.

    If you are going to do this a lot, a couple of macros such as Michael R suggests, one for portrait and one for landscape, on customs buttons speed up matters. I include the lines:

    .CenterHorizontally = True
    .CenterVertically = False

    rather than setting the left margin.

  6. #6
    FrankR
    Guest

    Re: Different Page Layouts For Multi-page Worksheet

    A different (hopefully easier) approach, that will allow both landscape and portrait off of the same sheet. Using File | Page Setup, get the first page set up the way you want it (including the print area). Under View | Custom Views, create a view for this (let's say First_Page). Now, go back to Page Setup and set up your second page. Back to Custom View and give this a name (Second_Page). Continue on in this manner until you have all of the sections of your report named. Then go to View | Report Manager and define a new report (My_Report) and add First_Page, Second_Page, etc. to your report. It will print out each section of your report for you using the page layouts for each section. And, you can have the page numbers run continuously through the entire report.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •