Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Page Break Preview

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Las Vegas Nevada USA
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I recorded a Macro to adjust the page breaks.

    Sub Macro2()
    ' Macro2 Macro

    ActiveWindow.SelectedSheets.PrintPreview
    ActiveSheet.PageSetup.PrintArea = "$A$1:$H$25"
    ActiveWindow.SelectedSheets.PrintPreview
    End Sub

    Try to run it and it stops at the Print Preview window. Click Page Break Preview and it continues and does the adjustment then goes back to Print Preview. You have to click on Normal View to get it to finish. What do you have to do to get to run all the way through???

  2. #2
    MrExcel MVP Anne Troy's Avatar
    Join Date
    Feb 2002
    Location
    Westwood NJ
    Posts
    2,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm not sure I understand the question. What is it exactly that you want to do? There are so many print settings in Excel that it's rarely necessary to set the print area unless you *must* keep other data on the same worksheet.

    Could you give more detail? Thanks!
    ~Anne Troy

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Las Vegas Nevada USA
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a workbook with a sheet that gets copied many times. Somhow the print area got screwed up before I noticed. I don't want to go through the effort of manually adjusting every sheet if a Macro will do it. Any solutions??

  4. #4
    MrExcel MVP Anne Troy's Avatar
    Join Date
    Feb 2002
    Location
    Westwood NJ
    Posts
    2,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I guess I don't understand the point of print preview at all. Just take both of those lines out of your code and just use the print area line.
    ~Anne Troy

  5. #5
    Board Regular
    Join Date
    Feb 2002
    Location
    Las Vegas Nevada USA
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey thanks Dreamboat. It works great. The Macro recorder put the print preview in and I didn't realize it was not necessary. Thanks again.
    George

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
  •