+ Reply to Thread
Results 1 to 2 of 2

Can't set "Fit to Page" in simple VBA macro

Hybrid View

  1. #1
    Registered User
    Join Date
    12-22-2010
    Location
    Fort Rouge, Canada
    MS-Off Ver
    Excel 2010
    Posts
    37

    Question Can't set "Fit to Page" in simple VBA macro

    Recorded a page setup macro and picked out the properties I wanted to set

    All get applied except the last 2 statements in the With clause

    What am I missing?

    ActiveSheet.PageSetup.PrintArea = "$B$1:$N$186"
    With ActiveSheet.PageSetup
        .LeftMargin = Application.InchesToPoints(0.25)
        .RightMargin = Application.InchesToPoints(0.25)
        .Orientation = xlLandscape
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
    Thanks in advance
    Last edited by finny388; 10-18-2011 at 05:06 PM. Reason: grammar

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,755

    Re: Can't set "Fit to Page" in simple VBA macro

    You are missing this:

            .Zoom = False
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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