Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Macro for modifying Page Setup - only part of it works

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Milwaukee, WI
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I've written this loop to modify the page setup for each page I need to print. When i step through it, it does indeed go to each page, but when it's done and I manually check the settings, the FitToPages...settings never stick. The footer is fine, but I can't tell it to print each page on ONE page. Anyone think they can help? I got the code from a recorded macro.

    For ContentCtr = 3 To (SheetCounter + 1) 'SheetCounter is defined earlier as thhe number of sheets I'm interested in
    Sheets(ContentCtr).Select
    ActiveSheet.PageSetup.PrintArea = ""
    ActiveSheet.PageSetup.FitToPagesWide = 1
    ActiveSheet.PageSetup.FitToPagesTall = 1
    ShtNum = ContentCtr
    Sheets(ContentCtr).PageSetup.RightFooter = "Page " & ShtNum
    Next ContentCtr

  2. #2
    . MrExcel's Avatar
    Join Date
    Feb 2002
    Location
    Merritt Island Florida
    Posts
    864
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default

    You need to set the .Zoom to False.

    ActiveSheet.PageSetup.Zoom = False

    The recorded macro should have done that for you. I realize many of those recorded lines are extraneous, but that one is necessary.

    Bill

    _________________
    MrExcel.com Consulting

    [ This Message was edited by: MrExcel on 2002-04-11 07:57 ]

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Milwaukee, WI
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Perfect.

    I don't know where you pick up these things, but that certainly did the trick. Thanks.

    JrnyMan
    Youngstown, Ohio
    (presently in London)

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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