+ Reply to Thread
Results 1 to 3 of 3

Marco for adjusting page layout

  1. #1
    Registered User
    Join Date
    01-24-2013
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    15

    Marco for adjusting page layout

    I need a macro that will change payge layout to landscape, adjust paper size to legal, and adjust scale to fit with width 1 page and height automatic. I have a macro for adjusting page layout to landscape that you can use as a base for the rest, I'm assuming they will be similar i just don't know codes for anything.
    '
    Sub PrinterFriendly()
    With ActiveSheet.PageSetup
    .Orientation = xlLandscape
    End With
    End Sub

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Marco for adjusting page layout

    Excel has a built in feature called record macro. If you activate the record macro then perform the operations that you indicated in your post it will probably create a code that will work for you. Give it a try and report back.

  3. #3
    Registered User
    Join Date
    01-24-2013
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Marco for adjusting page layout

    I got it to work, my issue was that when i set scale to fit width at 1 and wanted to leave scale to fit height at automatic, it would set the scale to fit height at 1 as well. It was solved by setting the scale to fit height at 999, a number which I won't hit at least for the file i was working on. So it looked like:

    With ActiveSheet.PageSetup
    .Orientation = xlLandscape
    .PaperSize = xlPaperLegal
    .FitToPagesWide = 1
    .FitToPagesTall = 999
    .Zoom = False
    End With

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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