+ Reply to Thread
Results 1 to 4 of 4

Thread: Code for Running Total Using only 2 cells

  1. #1
    Registered User
    Join Date
    01-15-2012
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    4

    Code for Running Total Using only 2 cells

    Not sure if this is possible, I'm assuming it can be done with VBA, but I don't know VBA. I'm trying to create a spreadsheet that uses one cell to enter a dollar amount and stores the amount entered in another cell. But I would like the input cell be zero after each entry, and the cell storing the amounts to keep a running total. Please help Thanks
    Last edited by navdad; 01-18-2012 at 01:07 AM.

  2. #2
    Forum Moderator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    4,371

    Re: Code for Running Total Using only 2 cells

    It will be good if you attach a sample file.
    Cheers,
    Arlette

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    01-15-2012
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Code for Running Total Using only 2 cells

    Problem solved everything working perfectly.. I'd like to thank Richard for the first part of the code. The second part took some trial and error but I final got it working. So I'm posting the code in case someone else comes across the same problem.

    Private Sub Worksheet_Change(ByVal Target As Range)
        
      Application.EnableEvents = False
        If Not Intersect(Target, Range("C2:C10")) Is Nothing Then
             Target.Cells(1, 2) = Target.Cells(1, 2) + Target
    
            End If
        Range("C2:C10").Select
          Selection.ClearContents
        Range("C2").Select
       Application.EnableEvents = True
            
    End Sub

  4. #4
    Registered User
    Join Date
    01-20-2012
    Location
    Alpharetta, GA, USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Code for Running Total Using only 2 cells

    OK, I was looking for the answer to this exact question. Problem is, I don't know how to use this answer as given. Is this a macro? How do I incorporate it?
    Thanks

+ 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.2.0