ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   calculating balances (https://www.excelbanter.com/excel-programming/421467-calculating-balances.html)

Yossy

calculating balances
 
Please all help totally appreciated. I want to add values to another value in
another cell but want to see the values as they add up.

E.g
Cell G3 = E26+200+500
Gell G20 = 100
I want to add G20 to G3: Is it possible to leave the values as G3=
E26+200+500+100 and even show the new value added of 100. THe code below
just sums up the total without showing the breakdown of values added so far.

With .Range("G3")
.Value = .Value + ws.Range("G20").Value
End With
With .Range("G10")
.Value = .Value + ws.Range("G21").Value
End With

Again is it possible to have G3 =E26+200+500+100 in G3 once code is
executed. This way I see the values added not the whole added nos. This I
need for G10 too when I add G21 value.

Thanks so much for helping out.


Per Jessen[_2_]

calculating balances
 
Hi

This should do it for the first cell

With .Range("G3")
formStr = .Formula
.Formula = formStr & "+" & ws.Range("G20").Value
End With

Regards,
Per

On 18 Dec., 01:09, Yossy wrote:
Please all help totally appreciated. I want to add values to another value in
another cell but want to see the values as they add up.

E.g
Cell G3 = E26+200+500
Gell G20 = 100
I want to add G20 to G3: Is it possible to leave the values as G3=
E26+200+500+100 *and even show the new value added of 100. THe code below
just sums up the total without showing the breakdown of values added so far.

With .Range("G3")
* * * * * * * * * * * * .Value = .Value + ws.Range("G20").Value
* * * * * * * * * * * * End With
* * * * * * * * * * * * With .Range("G10")
* * * * * * * * * * * * .Value = .Value + ws.Range("G21").Value
* * * * * * * * * * * * End With

Again is it possible to have G3 =E26+200+500+100 in G3 once code is
executed. This way I see the values added not the whole added nos. This I
need for G10 too when I add G21 value.

Thanks so much for helping out.



Don Guillett

calculating balances
 
Not quite sure what you want but these should cover it

Sub showvalueandsumifg3TEXT()
MV = Range("g3") & "+" & Range("g20")
MsgBox MV
Range("G3") = MV
End Sub
Sub showvalueandsumifg3FORMULA()
MV = Range("g4").Formula & "+" & Range("g20")
MsgBox MV
Range("G5") = MV
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Yossy" wrote in message
...
Please all help totally appreciated. I want to add values to another value
in
another cell but want to see the values as they add up.

E.g
Cell G3 = E26+200+500
Gell G20 = 100
I want to add G20 to G3: Is it possible to leave the values as G3=
E26+200+500+100 and even show the new value added of 100. THe code below
just sums up the total without showing the breakdown of values added so
far.

With .Range("G3")
.Value = .Value + ws.Range("G20").Value
End With
With .Range("G10")
.Value = .Value + ws.Range("G21").Value
End With

Again is it possible to have G3 =E26+200+500+100 in G3 once code is
executed. This way I see the values added not the whole added nos. This I
need for G10 too when I add G21 value.

Thanks so much for helping out.



Yossy

calculating balances
 
thanks, I really appreciate it.

"Per Jessen" wrote:

Hi

This should do it for the first cell

With .Range("G3")
formStr = .Formula
.Formula = formStr & "+" & ws.Range("G20").Value
End With

Regards,
Per

On 18 Dec., 01:09, Yossy wrote:
Please all help totally appreciated. I want to add values to another value in
another cell but want to see the values as they add up.

E.g
Cell G3 = E26+200+500
Gell G20 = 100
I want to add G20 to G3: Is it possible to leave the values as G3=
E26+200+500+100 and even show the new value added of 100. THe code below
just sums up the total without showing the breakdown of values added so far.

With .Range("G3")
.Value = .Value + ws.Range("G20").Value
End With
With .Range("G10")
.Value = .Value + ws.Range("G21").Value
End With

Again is it possible to have G3 =E26+200+500+100 in G3 once code is
executed. This way I see the values added not the whole added nos. This I
need for G10 too when I add G21 value.

Thanks so much for helping out.




Yossy

calculating balances
 
thanks, i really appreciate it.

"Don Guillett" wrote:

Not quite sure what you want but these should cover it

Sub showvalueandsumifg3TEXT()
MV = Range("g3") & "+" & Range("g20")
MsgBox MV
Range("G3") = MV
End Sub
Sub showvalueandsumifg3FORMULA()
MV = Range("g4").Formula & "+" & Range("g20")
MsgBox MV
Range("G5") = MV
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Yossy" wrote in message
...
Please all help totally appreciated. I want to add values to another value
in
another cell but want to see the values as they add up.

E.g
Cell G3 = E26+200+500
Gell G20 = 100
I want to add G20 to G3: Is it possible to leave the values as G3=
E26+200+500+100 and even show the new value added of 100. THe code below
just sums up the total without showing the breakdown of values added so
far.

With .Range("G3")
.Value = .Value + ws.Range("G20").Value
End With
With .Range("G10")
.Value = .Value + ws.Range("G21").Value
End With

Again is it possible to have G3 =E26+200+500+100 in G3 once code is
executed. This way I see the values added not the whole added nos. This I
need for G10 too when I add G21 value.

Thanks so much for helping out.





All times are GMT +1. The time now is 09:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com