+ Reply to Thread
Results 1 to 3 of 3

setting a print area

  1. #1
    Matilda
    Guest

    setting a print area


    I cannot arrive at the correct syntax to define my selected range as the
    print area:
    Set prntRng = Range(Cells(1, 1), Cells(i, 12))
    prntRng.Select
    ActiveSheet.PageSetup.PrintArea =

    Help appreciated, many thanks
    Matilda


  2. #2
    Martin Fishlock
    Guest

    RE: setting a print area

    The printarea is specified as a string. You therefore need to provide a
    string like

    ActiveSheet.PageSetup.PrintArea = "$A$1:$L$" & i

    or if you want to use the range address then:

    Set prntRng = Range(Cells(1, 1), Cells(i, 12))
    ActiveSheet.PageSetup.PrintArea = prntRng.address

    HTHs


    "Matilda" wrote:

    >
    > I cannot arrive at the correct syntax to define my selected range as the
    > print area:
    > Set prntRng = Range(Cells(1, 1), Cells(i, 12))
    > prntRng.Select
    > ActiveSheet.PageSetup.PrintArea =
    >
    > Help appreciated, many thanks
    > Matilda
    >


  3. #3
    Matilda
    Guest

    RE: setting a print area



    "Martin Fishlock" wrote:

    > The printarea is specified as a string. You therefore need to provide a
    > string like
    >
    > ActiveSheet.PageSetup.PrintArea = "$A$1:$L$" & i
    >
    > or if you want to use the range address then:
    >
    > Set prntRng = Range(Cells(1, 1), Cells(i, 12))
    > ActiveSheet.PageSetup.PrintArea = prntRng.address
    >
    > HTHs
    >
    >
    > "Matilda" wrote:
    >
    > >
    > > I cannot arrive at the correct syntax to define my selected range as the
    > > print area:
    > > Set prntRng = Range(Cells(1, 1), Cells(i, 12))
    > > prntRng.Select
    > > ActiveSheet.PageSetup.PrintArea =
    > >
    > > Help appreciated, many thanks
    > > Matilda


    > > Absolutely perfect, thankyou Martin! I can sleep now :-)


+ 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