+ Reply to Thread
Results 1 to 3 of 3

Automatically selecting print area based on Pivot Table size

  1. #1
    Registered User
    Join Date
    03-04-2005
    Posts
    34

    Automatically selecting print area based on Pivot Table size

    Hoping somebody can help me with this. I'm trying to implement code into excel that will setup the print area of the worksheet based on the size of the pivot table (since it is the only object on the sheet. The pivot table's size will grow month to month, so cell reference is irrelevant.

    Below is the code I came up with:

    Dim Rng As Range
    Set Rng = ActiveSheet.PivotTables("EEVPivot").TableRange2
    Rng.Select
    ActiveSheet.PageSetup.PrintArea = Rng
    Of course, this gives me the error
    "Unable to set the PrintArea property of the PageSetup class"
    What am I doing wrong?? Is there anybody out there who can help???

  2. #2
    Valued Forum Contributor
    Join Date
    08-26-2006
    Location
    -
    MS-Off Ver
    2010
    Posts
    388
    PageSetup.PrintArea requires a string in A1 style.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-04-2005
    Posts
    34
    I notied that it does select the area of the pivot table, but also noticed that it is including a lot of page breaks

+ 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