+ Reply to Thread
Results 1 to 3 of 3

Why is this code creating a new page?

Hybrid View

  1. #1
    Registered User
    Join Date
    03-16-2004
    Posts
    65

    Why is this code creating a new page?

    For some reason the following code creates a blank page everytime. Is there a way to have it not do this that I am not seeing?


        Sheets("currentweek").Select
        Range("A1").Select
        ActiveCell.CurrentRegion.Select
        ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
            Selection).CreatePivotTable TableDestination:="", TableName:= _
            "PivotTable6", DefaultVersion:=xlPivotTableVersion10
        ActiveSheet.PivotTableWizard TableDestination:=Sheets("PIVOT").Range("A1")
    Thanks in advance...
    Last edited by TyeJae; 10-31-2008 at 05:40 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482
    It's the CreatePivotTable part. without details I assume the default is new sheet.

    Perhaps all you meant to do was create the cache

        ActiveWorkbook.PivotCaches.Add SourceType:=xlDatabase, SourceData:=Selection
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-16-2004
    Posts
    65
    Thanks Andy.

+ 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