Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7415607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:20:06+00:00 2026-05-29T07:20:06+00:00

So to make this simple. I have Cells A,B,C,D Cell D = B-C B

  • 0

So to make this simple. I have Cells A,B,C,D

Cell D = B-C

B is basically apples won, and C is apples lost for explanation purposes. D is net apples.

I want to make it so that I can enter a number of apples won into cell A, and then it will add that number into Cell B, then clear the A or allow me to clear it while retaining Cell B value of B+A.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:20:07+00:00Added an answer on May 29, 2026 at 7:20 am

    Only with code

    If you:

    • right click you sheet tab
    • View Code
    • copy and paste the code below

    Then cells B1 to B5 will keep a running total of all the corresponding values in A1 to A5. Change this line Set rng1 = Intersect(Target, Range("A1:A5")) to set the range which the code works on (running totals are added to the immediate right)

    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim rng1 As Range
        Dim rng2 As Range
        Set rng1 = Intersect(Target, Range("A1:A5"))
        If rng1 Is Nothing Then Exit Sub
        Application.EnableEvents = False
        For Each rng2 In rng1.Cells
            rng2.Offset(0, 1).Value = rng2.Offset(0, 1).Value + rng2.Value
        Next
        Application.EnableEvents = True
    End Sub
    

    [updated – for your additional query you could try this]

    Private Sub Worksheet_Change(ByVal Target As Range)
        Dim rng1 As Range
        Dim rng2 As Range
        Application.EnableEvents = False
        Set rng1 = Intersect(Target, Range("A1:A5"))
        If Not rng1 Is Nothing Then Call UpdateCells(rng1, 1)
        Set rng1 = Intersect(Target, Range("D1:D5"))
        If Not rng1 Is Nothing Then Call UpdateCells(rng1, 2)
        Application.EnableEvents = True
    End Sub
    
    
    Sub UpdateCells(ByVal rng1, lngCol As Long)
        Dim rng2 As Range
        For Each rng2 In rng1.Cells
            rng2.Offset(0, lngCol).Value = rng2.Offset(0, lngCol).Value + rng2.Value
        Next
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, this is simple but I can't make it workn... blah! I have
After loading a PHP template (using jQuery's load function), this simple script won't make
I'm trying to make a simple C# web server that, at this stage, you
I have a very simple ASP.Net page that acts as a front end for
Ho to make this simple xml with php using DOM? Full code will be
I can not get to make this comparison in this simple code error ..
Simple question, how make this code working ? public class T { public static
I would like to make a simple desktop application to learn this kind of
This one seems to be a simple problem, but I can't make it work
I am using RijndaelManaged to make a simple encryption/decryption utility. This is working fine,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.