+ Reply to Thread
Results 1 to 5 of 5

Calculating total using vba

  1. #1
    Registered User
    Join Date
    08-29-2013
    Location
    brooklyn
    MS-Off Ver
    Excel 2003
    Posts
    11

    Unhappy Calculating total using vba

    I would like the attached spreadsheet to calculate the total for all 10 colums on each dated spreadsheet(created daily), and place the results on a sheet named "TOTAL". The problem i have is that each day my code creates sheet in "yyymmmdd" format, so it hides the previous days spreadsheet and creates a new dated spreadsheet each day. Each spreadsheet is copied from a sheet i named "TEMPLATE". what I would like the vba to do is capture the results from the previous days including present day and sum everything up on the "TOTAL" sheet Can anyone HELP with this it is very important and WORK CRITICAL.I am attaching my work so far with vba code

    P S the previous days are hidden along with the template. you can unhide it to view


    MUCHOS GRACIAS
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-27-2013
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Calculating total using vba

    Just to ask, wouldn't it be easier to just append each day below previous day? In that way you would have everything in one sheet and just could summarize data with pivot ... that seems much easier to me. Also, there is a limit on 256 sheets and year has 354 days, so after 256 sheets you could not do it in this way any more ... but if you would just append new data below old data then you would have 100 rows per day * 356 days = approx. 35600 rows/year (based on size of your sheet) what would be still smalled excel file than this.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,832

    Re: Calculating total using vba

    I agree that putting this data on a single sheet and adding a column for date is a much better design than putting each day on a new worksheet. It provides much more power in terms of being able to analyze and report on the data. That would also allow you to do everything with formulas without VBA, so that the data on Totals would be automatically up to date with no user action.

    I have done a redesign showing how this can be done. I have added a pivot table on TOTALS to show how you can also report totals by day automatically. File is attached.

    However, ExcelDominator, please note there is no limit on the number of worksheets, except for available memory. (The link is for 2003 but also true for subsequent versions.)
    Attached Files Attached Files
    Last edited by 6StringJazzer; 09-13-2013 at 09:42 AM. Reason: Finally succeeded in attaching file, see blue text
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    08-27-2013
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Calculating total using vba

    I had situation where on domain network with terminal users (thin clients) I made application for 40 people (their idea) in which they opened new sheet entered some informations and CEO would just open his excel, click one button and gather all data in one file.
    Even though I know that there should not be limits, I ecountered on few computers on 256 sheets limit. Why? I do not know but it was like that even though we all had same thin clients in whole company. But surely, whatever the cause is, 200 sheets in one excel is not an answer.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,832

    Re: Calculating total using vba

    Quote Originally Posted by ExcelDominator View Post
    ...200 sheets in one excel is not an answer.
    Agree completely. And by the way, welcome to the Forum!

+ 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. Calculating % Row Total in DAX
    By vkievsky in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-07-2013, 12:22 PM
  2. Calculating Total
    By maxim.pinto in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-23-2012, 08:56 AM
  3. Calculating total
    By peteuga in forum Excel General
    Replies: 9
    Last Post: 01-26-2011, 10:30 AM
  4. calculating Total hours
    By paultyler in forum Excel General
    Replies: 2
    Last Post: 06-24-2008, 05:02 PM
  5. calculating total time
    By bcamp1973 in forum Excel General
    Replies: 4
    Last Post: 05-08-2006, 02:32 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