Code for calculation in cell where figures are entered

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Hi,
I need some advice please as not being able to get my head around this simple issue.

Column G = Column A + Column H

So i the user would enter a value in the cell at Column A & also enter a value in the cell at Column H, the combined total then would be shown in the cell at Column G
In i previous post for another issue but similair to this when a value is entered in the cell the Formaula etc is removed.

This is the part im stuck with.

Many thanks
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
when a value is entered in the cell the Formaula etc is removed.

What does this mean? Which cell? What formula? What is "etc."?

Do you mean that after the user enters a value in A, and a value in H, then G shows the sum and converted from a formula to a value? I'm guessing here.
 
Upvote 0
If the cell in column G has a formula and the user enters something in that cell, then the cell contains the user entry, not the formula.

What part of this is a problem for you?

If you are trying to set up a relationship between cells, so that A+H=G no matter which cell the user enters data into, Excel doesn't do that (absent VBA).
 
Upvote 0
I understand what you are saying Mikerickson by the user entering a value then the formula is gone.
I was trying to get around the USER putting the value in the cell.
Wondering if a code / formula would be accepted & did it for you after seeing a value in Cell A + H
 
Upvote 0
ipbr21054 your question is not clear. Please explain exactly what you want your user to be able to do, and what results you want from the user's point of view after they do it.

The first part of your first post
So i the user would enter a value in the cell at Column A & also enter a value in the cell at Column H, the combined total then would be shown in the cell at Column G
is easy--just put a formula in column H.

The rest of the post
when a value is entered in the cell the Formaula etc is removed.
sorry but it doesn't make sense.
 
Upvote 0
Its not easy because the formula is the deleted when the value enters the cell.
 
Upvote 0
I understand what you are saying Mikerickson by the user entering a value then the formula is gone.
I was trying to get around the USER putting the value in the cell.
Wondering if a code / formula would be accepted & did it for you after seeing a value in Cell A + H
A cell can hold a value or a formula but not both. I doesn't matter if it is the user or code that writes to the cell.

As I said above, VBA could be used to set up the relationship of G = A+H so that values could be entered in any cell and the others follow suit.
 
Upvote 0
So maybe something like this would work for me.
Range(“G1”).Formula =“=SUM(A1:H1)”

But I can’t then copy that multiple times so need to do it for each cell in range etc.
But not sure how to write this.
Assume the range is row 1 to row 30 as an example. I can then go from there.
Thanks.
 
Last edited:
Upvote 0
Do you want a formula in column G or do you want the value.
When the user types something in column G, what do you want to happen?
BTW, the formula you mention results in a circular reference errror,.
 
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,830
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top