+ Reply to Thread
Results 1 to 4 of 4

set print area from selected range

  1. #1
    Graham Whitehead
    Guest

    set print area from selected range

    Hi, I have some code which selected a certain amount of columns depending on
    whether they contain values or not. Once I have this range set and I select
    it I want to set this as the print area. I am not quite sure how to do
    this. for example I tried:

    rngUnion.Select
    ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address

    But to no avail. Any help would be gratefully received.



  2. #2
    Ardus Petus
    Guest

    Re: set print area from selected range

    Try:
    ActiveSheet.PageSetup.PrintArea = Selection.address

    HTH
    --
    AP

    "Graham Whitehead" <[email protected]> a écrit dans le message de
    news: [email protected]...
    > Hi, I have some code which selected a certain amount of columns depending
    > on whether they contain values or not. Once I have this range set and I
    > select it I want to set this as the print area. I am not quite sure how
    > to do this. for example I tried:
    >
    > rngUnion.Select
    > ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
    >
    > But to no avail. Any help would be gratefully received.
    >




  3. #3
    Graham Whitehead
    Guest

    Re: set print area from selected range

    Thanks, but didnt work.

    "Ardus Petus" <[email protected]> wrote in message
    news:[email protected]...
    > Try:
    > ActiveSheet.PageSetup.PrintArea = Selection.address
    >
    > HTH
    > --
    > AP
    >
    > "Graham Whitehead" <[email protected]> a écrit dans le message de
    > news: [email protected]...
    >> Hi, I have some code which selected a certain amount of columns depending
    >> on whether they contain values or not. Once I have this range set and I
    >> select it I want to set this as the print area. I am not quite sure how
    >> to do this. for example I tried:
    >>
    >> rngUnion.Select
    >> ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
    >>
    >> But to no avail. Any help would be gratefully received.
    >>

    >
    >




  4. #4
    Ardus Petus
    Guest

    Re: set print area from selected range

    The code I gave you sets the current selection as printarea.
    Select something else!

    Cheers,
    --
    AP

    "Graham Whitehead" <[email protected]> a écrit dans le message de
    news: [email protected]...
    > Thanks, but didnt work.
    >
    > "Ardus Petus" <[email protected]> wrote in message
    > news:[email protected]...
    >> Try:
    >> ActiveSheet.PageSetup.PrintArea = Selection.address
    >>
    >> HTH
    >> --
    >> AP
    >>
    >> "Graham Whitehead" <[email protected]> a écrit dans le message de
    >> news: [email protected]...
    >>> Hi, I have some code which selected a certain amount of columns
    >>> depending on whether they contain values or not. Once I have this range
    >>> set and I select it I want to set this as the print area. I am not
    >>> quite sure how to do this. for example I tried:
    >>>
    >>> rngUnion.Select
    >>> ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
    >>>
    >>> But to no avail. Any help would be gratefully received.
    >>>

    >>
    >>

    >
    >




+ 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