+ Reply to Thread
Results 1 to 10 of 10

Macro for running total

  1. #1
    Registered User
    Join Date
    07-01-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Macro for running total

    hello,

    Can anyone help me in writing Macro for the below situation:

    Date a b c d e
    7/1/2013 $12.00 $54.00 $32.00 $48.00 $56.00

    The first cell (range "A") is date and other cells (range "B" to "F" - this may further be required to extend) are sales values for the date. Now there will values falling every day underneath this for the remaining month, and the values should have cumulative values generated on the daily basis. For the 1st day of the month the sales value and cumulative value would be the same, now from the 2nd day of the month on-wards the value should add up to its preceding days cumulative value in each cell. How to go about it. Any help would be greatly appreciated.

    Thanks.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro for running total

    Sounds to me like you should be able to do this with sum formulas?

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro for running total

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-01-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro for running total

    Thank you for writing, but when I run this code I am getting "runtime error - 1004" Application-defined or Object-defined error". Please let me know on avoiding this error.

  5. #5
    Registered User
    Join Date
    07-01-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro for running total

    yeah.. thanks for your reply, we can achieve this by writing summation (=SUM($A$1:A1)) formula. But I was wondering if any Macro for this will help.

  6. #6
    Registered User
    Join Date
    07-01-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro for running total

    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe:

    Please Login or Register  to view this content.
    Thank you for writing, but when I run this code I am getting "runtime error - 1004" Application-defined or Object-defined error". Please let me know on avoiding this error.

  7. #7
    Registered User
    Join Date
    07-01-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro for running total

    Quote Originally Posted by XeRo Solus View Post
    Sounds to me like you should be able to do this with sum formulas?
    yeah.. thanks for your reply, we can achieve this by writing summation (=SUM($A$1:A1)) formula. But I was wondering if any Macro for this will help.

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro for running total

    Quote Originally Posted by prakashananth View Post
    Thank you for writing, but when I run this code I am getting "runtime error - 1004" Application-defined or Object-defined error". Please let me know on avoiding this error.
    Can you attach a file? It works on the data I tested it on without the error.

    To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

  9. #9
    Registered User
    Join Date
    07-01-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro for running total

    Quote Originally Posted by JOHN H. DAVIS View Post
    Can you attach a file? It works on the data I tested it on without the error.

    To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.
    oh now it worked...worked like a charm.

    Thanks a ton John for your timely help.

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro for running total

    You're welcome. Glad to help out, and thanks for the feedback. Please comply with Forum Rule No. 9.


    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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