+ Reply to Thread
Results 1 to 16 of 16

Creating a summary table that has totals

  1. #1
    Registered User
    Join Date
    06-11-2014
    Posts
    20

    Exclamation Creating a summary table that has totals

    Hello,

    I am looking to solve the following problem using VBA:

    I receive a data table every day of the month. An example of how the data is organized is provided. What I need to do is create a monthly summary of all this data.

    Basically what i'm dealing with here is 30 separate sheets that contain the daily numbers - "daily summary" for each day of the month. I have created a macro that puts all the tables on one sheet. Now I just need to aggregate the daily numbers into one "summary" table. The table would be organized just like the daily tables, but instead of having daily totals, would have the monthly totals for each category.

    Some of the daily data tables have more companies listed, while others will have less. The summary table will have all the companies listed. It's just a question of adding the daily numbers from the same categories of data together and displaying the totals in the summary table.

    Any help is appreciated. Thanks!

    - J
    Attached Files Attached Files
    Last edited by jcroque89; 01-25-2015 at 08:58 PM.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Creating a summary table that has totals

    372816d1422215794-creating-a-summary-table-that-has-totals-example.xlsxDoes it have to use VBA or can it use a formula? See attached
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    06-11-2014
    Posts
    20

    Re: Creating a summary table that has totals

    VBA solution would be ideal. Thank you.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Creating a summary table that has totals

    Hi jcroque89

    Please show us this...perhaps we can help.
    Basically what i'm dealing with here is 30 separate sheets that contain the daily numbers - "daily summary" for each day of the month. I have created a macro that puts all the tables on one sheet
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Registered User
    Join Date
    06-11-2014
    Posts
    20

    Re: Creating a summary table that has totals

    What I mean by "30 different sheets" is that I am provided with a data table everyday that contain amounts (for that day). So for a month like September, I would have 30 such tables of data (one for each day). Each table will contain the numbers for whatever amounts were gathered that day.

    The macros I created assembles all that data on one sheet. All I do is click on a button, and the macros prompts to open a file from my desktop. I select a workbook and the macros will open it, copy the data, and paste the data onto one sheet. I do this for each daily table file and so by the end, I will have a stack of all of them in one worksheet. What I need now is to add all that information into one table. The table would have the totals for the month.

    I figured in the example I provided, if I could do it with two tables, I would just tweak/add code in order to do it for 30 tables (or however many I had for that month).

    I created those tables as examples, and they reflect the construction of the data exactly. The data I am actually using is company sensitive so I can't provide it.

    The macros I am using to open and consolidate the tables into one worksheet is as follows:

    Sub CopyPaste_New_Daily_Data()
    '
    '
    Dim ReportWbk As Workbook 'workbook with report data
    Dim Report As String 'name of file with report data
    '
    Application.FileDialog(msoFileDialogFilePicker).Show
    Report = Application.FileDialog(msoFileDialogFilePicker).SelectedItems(1)
    Set ReportWbk = Workbooks.Open(Report)
    '
    ReportWbk.Sheets(1).Range("A1").Select
    ActiveCell.Range("A1:P28").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    '
    ThisWorkbook.Sheets("Data").Activate
    Range("A" & Rows.Count).End(xlUp).Offset(1).Select
    ActiveSheet.Paste
    '
    ReportWbk.Close (False)
    ThisWorkbook.Sheets("Button").Activate
    '
    '
    End Sub

    - J

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Creating a summary table that has totals

    Try this attachment
    May be someone develop it to be ideal
    Attached Files Attached Files
    Last edited by YasserKhalil; 01-25-2015 at 05:03 PM.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Creating a summary table that has totals

    Try the attached
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-11-2014
    Posts
    20

    Re: Creating a summary table that has totals

    Jindon - Thank you! The code works well. I will try to apply it so that it will do so with the rest of the daily tables included.

    YasserKhalil - Thank you for your suggestions and efforts. Much appreciated.

    - J

  9. #9
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Creating a summary table that has totals

    Mr. Jindon I tried your attachment and I encountered an error at this line
    Please Login or Register  to view this content.

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Creating a summary table that has totals

    Can not replicate the error here.

  11. #11
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Creating a summary table that has totals

    Quote Originally Posted by jindon View Post
    Can not replicate the error here.
    I didn't get what you mean by this sentence ..
    Do you mean that this line can't be an error!! or you mean I don't have to post errors in this thread?

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Creating a summary table that has totals

    Means runs without error, so I can not replicate the error that you are saying here.

  13. #13
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Creating a summary table that has totals

    Mr. Jindon English is not my native language and I didn't recognize what the word (replicate ) means ..
    Do you mean that there is no error when you run this macro??
    Is there a library reference to be added? > May be regional settings may cause the error

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Creating a summary table that has totals

    I think it's a matter of date format for regional setting, but I don't know why you are getting error.

    Dates are trouble anyway.

  15. #15
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Creating a summary table that has totals

    What's the suitable format in regional setting for dates to avoid that error?

  16. #16
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Creating a summary table that has totals

    No idea, and I don't want to touch to my Regional Settings....

+ 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] Bring Pivot table totals to summary sheet
    By ZuneidDassu in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-04-2014, 06:03 AM
  2. Creating a summary of totals in a recipe counter
    By chefpaddy in forum Excel General
    Replies: 3
    Last Post: 10-22-2012, 01:53 PM
  3. Creating summary totals
    By Gazzr in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-25-2008, 03:19 AM
  4. Pivot Table - creating % of Totals
    By BernzG in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-12-2006, 07:15 PM
  5. How do I show summary totals from a pivot table on a bar chart
    By Colleen T in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 01-21-2005, 10:06 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