+ Reply to Thread
Results 1 to 3 of 3

Creating a summary table in VBA

  1. #1
    Registered User
    Join Date
    01-13-2016
    Location
    Europe
    MS-Off Ver
    2013
    Posts
    46

    Creating a summary table in VBA

    Hi all,

    Can someone help me with a VBA code that will generate a summary table based on the data sheet.

    The challenge for me is to create a choice form(similar to a pivot header) so that I can choose the specific values that will be input for the summary table.
    Please open the excel file attached. I have attached all the comments so I hope that will help you understand better what I mean.

    I will really appreciate the help !

    Thank you very much!

    Best regards,
    red1234
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Creating a summary table in VBA

    Why not use a pivot table? First of all, clean up the data to get a consistent spelling of "In Progress." I noticed that each status had a trailing space.

    Then convert the data into an Excel Table for two reasons: Excel Tables "remember" formulas and copy them down automatically and they know how big they are so pivot tables and formuals built from them always address the exact amount of data they need.

    I added three helper columns in columns F:H: one for each status. They have formulas like: =IF(TRIM([@Status])="Approved",1,0) - the reason for the TRIM is because of the trailing spaces in the data. I am assuming that you are copy and pasting data in and these may have the trailing spaces in there. So if you clear the data table and then copy/paste data into columns A:E (data only do not copy in the headers). Then columns F:G will fill in automatically.

    Then it's a matter of building a pivot table with this data. I created calculated fields based on the three helper columns. I also threw in a slicer. Slicers are just fancy filters and are easy to do. Click in the pivot table then select Insert->Slicer from the ribbon. Do a web search on slicers and you'll get several examples of things you can do with them. Slicers make it easier to see what you have selected instead of "Multiple Items."
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    01-13-2016
    Location
    Europe
    MS-Off Ver
    2013
    Posts
    46

    Re: Creating a summary table in VBA

    Hi,

    Thanks a lot for the response. Very useful.

    Best regards,
    red1234

+ 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] Creating a Summary Table by Group
    By Isara1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-24-2016, 10:25 PM
  2. Creating rolling summary table
    By paula10 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-26-2015, 10:11 AM
  3. [SOLVED] Creating a summary table that has totals
    By jcroque89 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-26-2015, 08:20 AM
  4. [SOLVED] Creating a table or summary? Not sure how to describe it
    By chromecarz00 in forum Excel General
    Replies: 5
    Last Post: 04-17-2014, 06:00 PM
  5. [SOLVED] Hi there, i need you help for creating a summary table from a dataset.
    By ykw1991 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-23-2013, 12:26 AM
  6. Creating a summary table using formula
    By arbrahul in forum Excel General
    Replies: 2
    Last Post: 05-29-2012, 12:15 PM
  7. Creating Summary table from one workbook to another
    By mcollins999 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-24-2012, 10:43 AM

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