Results 1 to 3 of 3

VBA -- Creating Pivot Table from datamodel table

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-05-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2016
    Posts
    110

    VBA -- Creating Pivot Table from datamodel table

    Dear all,

    I have data, ticket details in sheet " Backlog " which had duplicate entries. I need to prepare a summary in sheet " Backlog_Summary " for unique ticket no. entries.

    Manually, I select the entire table and create a pivot by adding it the data to a data model. This will enable to create summary by using Distinct Count. { This is my goal }

    I have the following VBA Code which I had modified based on macro recording when I did it manually. However, the following code doesn't do anything:

      ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=ActiveWorkbook.Connections("WorksheetConnection_Backlog!" & srange), Version:=6). _
        CreatePivotTable TableDestination:="Backlog_Summary!R1C1", TableName:="BacklogSummaryPivotTable", DefaultVersion:=6
    I've attached the macro file which has the whole code.

    Could you please help me understand the mistake and correct the code?

    Appreciate any help on the same.

    Thanks,
    Vinod Krishna
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 01-24-2017, 06:56 PM
  2. Creating a Pivot Table using Data Table in different file?
    By JasonMcQueen in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-13-2016, 11:56 AM
  3. [SOLVED] Creating a formula in a pivot table while using another calculated item in the pivot
    By mvhs1073933 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-10-2015, 12:44 PM
  4. Replies: 1
    Last Post: 07-29-2015, 05:19 PM
  5. Replies: 1
    Last Post: 07-29-2015, 05:15 PM
  6. Replies: 0
    Last Post: 08-09-2013, 12:32 PM
  7. Creating a table/array from Pivot Table
    By Roktgr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-22-2010, 07:02 PM

Tags for this Thread

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