Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Feb 2001
    Location
    North Carolina, USA
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select 'PageBreakPreview' (VBA /Excel97sr2)

    If the window.view = xlPageBreakPreview, is there a VBA-way to select
    and copy just the preview area of the worksheet?
    I know I can manually select and then "set print area" in excel and then grab it with VBA -- but I was hoping there was some VBA code that would
    do this for me. By the way - there are usually 1 or 2 blank columns on
    the far right of the PageBreakPreview area - due to a company logo in
    the top right of the worksheet.
    Any suggestions, please?
    Thanks, Phyl

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Select 'PageBreakPreview' (VBA /Excel97sr2)

    The print area selected manually is automatically given the Range Name "Print_Area" by Excel; depending on what you want to do you could try grabbing that named Range and manipulating it, independent of xlPageBreakPreview.
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Lounger
    Join Date
    Feb 2001
    Location
    North Carolina, USA
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select 'PageBreakPreview' (VBA /Excel97sr2)

    Thanks, John, but I don't want a user to have to set the print area before
    running my macro. I just want to know if I can select only the windows
    "page break preview" area using VBA?
    I just can't find the answer in "Help" or any of my reference books??
    Maybe I don't know how to look it up!
    still trying....
    Phyl

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Select 'PageBreakPreview' (VBA /Excel97sr2)

    Will Selection.CurrentRegion.Select work for your purposes?
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Select 'PageBreakPreview' (VBA /Excel97sr2)

    Does <pre> ActiveWindow.View = xlPageBreakPreview </pre>

    help ?

    Andrew C

Posting Permissions

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