+ Reply to Thread
Results 1 to 4 of 4

Question: different page orientations for different print areas

  1. #1
    Registered User
    Join Date
    06-09-2014
    Posts
    3

    Question: different page orientations for different print areas

    I currently have a macro that pulls data from a workbook and creates a new workbook with a sheet called "Appendix A." This sheet contains seven print areas. Below you can see the relevant code from my macro. The problem I am facing is that I would like the first print area ($G$8:$Q$40) to be Landscape for when I go to print, the second and third print areas ($C$42:$M$108,$O$42:$Y$108) to be Portrait, and the fourth through seventh print areas ($C$110:$M$157,$C$159:$M$206,$O$110:$Y157,$O$159:$Y$206) to be Landscape. Any ideas how and where I can type this fix?

    Thank you!

    PHP Code: 
     Calculate
                 Call Top40
                 Call Top40Trend
                 
                    Application
    .StatusBar "Macro - Running"
                    
    Workbooks.Add
                    Temp1 
    ActiveWorkbook.Name
                    Windows
    (Thisfile).Activate
                    Sheet9
    .Select
                    ActiveSheet
    .Copy before:=Workbooks(Temp1).Sheets(1)
                    
    Workbooks(Temp1).Activate
                    Range
    ("c1:y210").Select
                    Selection
    .Copy
                    Selection
    .PasteSpecial Paste:=xlPasteValuesOperation:=xlNoneSkipBlanks _
                        
    :=FalseTranspose:=False
                    Application
    .CutCopyMode False
                    Range
    ("a1:b210").ClearContents
                    Range
    ("z1:AF20").Delete
                    Range
    ("aa113:Af210").Delete
                    
                    ActiveSheet
    .Select
                    Rows
    ("40:40").Select
                    Selection
    .Insert shift:=xlDowncopyorigin:=FormatFromleftorabove
                    
                    ActiveSheet
    .PageSetup.PrintArea "$G$8:$Q$40,$C$42:$M$108,$O$42:$Y$108,$C$110:$M$157,$C$159:$M$206,$O$110:$Y157,$O$159:$Y$206"
                    
    ActiveSheet.Name "Appendix A NPA" sitenumber
                    Cells
    .Select
                        Selection
    .Locked False
                        Selection
    .FormulaHidden False
                        Range
    ("a1:c4").Select
                        Selection
    .Locked True
                        Selection
    .FormulaHidden False
                        ActiveSheet
    .Protect DrawingObjects:=TrueContents:=TrueScenarios:=True
                        ActiveSheet
    .EnableSelection xlUnlockedCells
                        ActiveSheet
    .Range("a1").Select 

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,620

    Re: Question: different page orientations for different print areas

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    06-09-2014
    Posts
    3

    Re: Question: different page orientations for different print areas

    This looks promising––thanks for helping me out. Where would I input this within my entire macro?

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,620

    Re: Question: different page orientations for different print areas

    Without seeing the actual code, I'm guessing it will look something like:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to print multiple print areas on one page.
    By morangeman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2015, 12:13 PM
  2. [SOLVED] How to Print different areas on one page
    By Bryan Bloom in forum Excel General
    Replies: 6
    Last Post: 11-12-2011, 11:46 AM
  3. How to print multiple print areas on the same page.
    By Dalilah in forum Excel General
    Replies: 5
    Last Post: 08-27-2008, 09:05 AM
  4. Can i print non-contiguous areas on one page??
    By yiota in forum Excel General
    Replies: 2
    Last Post: 03-27-2006, 09:55 AM
  5. [SOLVED] Can i print non-contiguous areas on one page
    By yiota in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-27-2006, 07:30 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1