+ Reply to Thread
Results 1 to 7 of 7

Create Pivot Table, Extract Colum/Row/Value Separately

  1. #1
    Registered User
    Join Date
    02-10-2020
    Location
    Manchester, England
    MS-Off Ver
    365
    Posts
    19

    Unhappy Create Pivot Table, Extract Colum/Row/Value Separately

    Long story short, I've been using VBA as a side interest that has happened to bring some value to my current role (albeit scripting isn't my full time role) and my employer is now scaling back on non-supported coding as they have a full team in place to do this in an official capacity. However just before the cut off, a team has dropped a request in that I feel is a bit above my level so I'm hoping someone here can help me get this last project over the line before I say goodbye to this aspect of my job.

    Summary: Our customers across multiple sites have their user transactions merged into dataset (Sheet: DataSet1). From this customer data, a Pivot Table is required to subtotal all the currencies and Customer References, followed by a line by line breakdown underneath (Example Sheet: DataSet1_Pivot, can stay on same sheet as data when coded) and have those 3 short rows moved to the first available empty row on a separate sheet with pre-saved headers (Sheet: Processing). The sheet will then use a VLOOKUP on the adjacent cells to check the Customer Ref to see which entity it is related to (on a separate ref sheet) and then pull the appropriate payment details across from it in the cells adjacent on the right (I will have these formulas on the sheet already in the final product once I get to that stage).

    So far I've coded the MasterFile to import the data from our networked file paths so the DataSet1 information will be ready each day. I have managed to code the Pivot Table aspect but this was based on recording the Macro and recreating it so if anyone is knowledgeable enough to do this it would be a huge help. My main issue is pulling the data from the Pivot Table out and separating by rows as I have done underneath it and then copying it to the Processing Sheet.

    I think I can handle the rest from that point but it is just that simple Pivot Table data part that I'm struggling with. The amount of Customers and Currencies used each day could be lots of very few so it needs to dynamic in how it loops through. I've made the dummy data as bland as possible but I'll have to rename a lot of columns etc when I move it to my work project file.

    Any help would be massively appreciated, as I've said I will be moving away from this in a work capacity soon but this is one of the last few things I need to get over the line. I've been given til the end of this week to get it cleared so it is stressing me out a bit.
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,876

    Re: Create Pivot Table, Extract Colum/Row/Value Separately

    With Power Query/Get and Transform here is the Mcode for the Pivot Table.

    Please Login or Register  to view this content.
    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    1
    Customer Ref New USD EUR GBP CAD AUD
    2
    CR-O00001
    18.2
    18.8
    25.7
    16
    17.9
    3
    CR-O00002
    19
    22.7
    31.1
    21.2
    29.6
    4
    CR-O00003
    14.1
    11.8
    13.1
    13.3
    24.4
    Sheet: Table1


    If you look at the spreadsheet and open the Query Editor and then look at the grouped rows line of code, it presents the table you want. If you wish to export this to native excel, then delete the last step of pivoting the data and close and load.

    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files
    Last edited by alansidman; 05-24-2021 at 11:40 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-10-2020
    Location
    Manchester, England
    MS-Off Ver
    365
    Posts
    19

    Re: Create Pivot Table, Extract Colum/Row/Value Separately

    Apologies, I can’t install Addons on my Work Install.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,876

    Re: Create Pivot Table, Extract Colum/Row/Value Separately

    You do not need to install anything. Power Query which is called Get and Transform in your version is already part of your version as I indicated in my previous post. It is found on the Data Tab of the Ribbon.

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Create Pivot Table, Extract Colum/Row/Value Separately

    @ Alandsiman
    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Is there links recorded ?
    - Battle without fear gives no glory - Just try

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,876

    Re: Create Pivot Table, Extract Colum/Row/Value Separately

    Not sure why the links did not come over. Will try again.

    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Create Pivot Table, Extract Colum/Row/Value Separately

    Thx Alan for your support.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to extract data from a table using a colum index
    By PDC95 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-28-2020, 04:21 AM
  2. Replies: 6
    Last Post: 01-24-2017, 06:56 PM
  3. Replies: 0
    Last Post: 01-06-2016, 07:00 AM
  4. Extract date and time separately from a cell
    By narulaoverseas in forum Excel General
    Replies: 12
    Last Post: 09-12-2015, 01:28 AM
  5. Pivot table - count data in 2 colums separately
    By soxes in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-08-2015, 08:08 PM
  6. Colum totals based on ID and Pivot Table assistance
    By robertguy in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 01-22-2014, 03:37 PM
  7. Pivot table colum width
    By LouP in forum Excel General
    Replies: 4
    Last Post: 11-27-2006, 02:55 PM

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