+ Reply to Thread
Results 1 to 2 of 2

[SOLVED] Cumulative total

  1. #1
    Jesse
    Guest

    [SOLVED] Cumulative total

    Hi, I need to keep a cumulative total in one cell P2 as cell B2 is updated
    with new entries. Thanks in advance

  2. #2
    Jim Thomlinson
    Guest

    RE: Cumulative total

    If I understand your question correctly you will be overwiting the value in
    B2 and you want to sum the total in P2 each time you change...

    Here is some code to do that:
    Option Explicit

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address = "$B$2" Then _
    ActiveSheet.Range("P2").Value = ActiveSheet.Range("P2").Value +
    Target.Value

    End Sub

    To paste the code Right Click on the sheet tab -> Select View Code (The
    visual basic screen will open up) -> Paste the code...

    To be safe you should validate what is being enetered in cell B2. Data ->
    Validation ...(make sure that it is a number)

    HTH

    "Jesse" wrote:

    > Hi, I need to keep a cumulative total in one cell P2 as cell B2 is updated
    > with new entries. Thanks in advance


+ 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