PC Review


Reply
Thread Tools Rate Thread

Cumulative value in a single cell

 
 
Shah Alam
Guest
Posts: n/a
 
      2nd Jul 2009

Dear xls xperts,
I want the solution below.

cell A
Cell B
Cell C
Suppose, i put 50 in cell B, Cell A will take it and add the number
frequently. again if I delete or put another 50 on cell B, even then cell A
will show me 100(50+50) whereas Cell C will only minus the number that Cell
B helps Cell A to add. thanks

Shah Alam
 
Reply With Quote
 
 
 
 
Tom Hutchins
Guest
Posts: n/a
 
      2nd Jul 2009

I don't understand what you want to do with cell C. You can accumulate values
entered into cell B in cell A using an event macro like the following:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Address(False, False) = "B1" Then
If IsNumeric(.Value) Then
Application.EnableEvents = False
Range("A1").Value = Range("A1").Value + Range("B1").Value
Application.EnableEvents = True
End If
End If
End With
End Sub

In this example, A1 is cell A and B1 is cell B. Right-click on the name tab
of the sheet where you want this to work, then select View Code. The Visual
Basic Editor (VBE) is displayed. Paste the code above in the blank window.
Save the workbook, then close the VBE and return to Excel.

There are pitfalls to using a cell as an accumulator. Here is link to more
information:
http://www.mcgimpsey.com/excel/accumulator.html

If you are new to macros, this link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/200...e-elses-macro/

Hope this helps,

Hutch

"Shah Alam" wrote:

> Dear xls xperts,
> I want the solution below.
>
> cell A
> Cell B
> Cell C
> Suppose, i put 50 in cell B, Cell A will take it and add the number
> frequently. again if I delete or put another 50 on cell B, even then cell A
> will show me 100(50+50) whereas Cell C will only minus the number that Cell
> B helps Cell A to add. thanks
>
> Shah Alam

 
Reply With Quote
 
Shah Alam
Guest
Posts: n/a
 
      3rd Jul 2009

thank you very much.
it's done well
Shah Alam


"Shah Alam" wrote:

> Dear xls xperts,
> I want the solution below.
>
> cell A
> Cell B
> Cell C
> Suppose, i put 50 in cell B, Cell A will take it and add the number
> frequently. again if I delete or put another 50 on cell B, even then cell A
> will show me 100(50+50) whereas Cell C will only minus the number that Cell
> B helps Cell A to add. thanks
>
> Shah Alam

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
consolidate data (i.e. a single cell) from multiple spreadsheets intoa single sheet James Sheriff Microsoft Excel Programming 4 4th Aug 2010 05:35 PM
consolidate data (i.e. a single cell) from multiple spreadsheets intoa single sheet James Sheriff Microsoft Excel Discussion 1 4th Aug 2010 03:56 PM
From single cell variables to a single column serie =?Utf-8?B?bm95YXU=?= Microsoft Excel New Users 1 22nd Dec 2006 06:43 AM
in the one cell add 5+13+22+6+ to get cumulative total each time? =?Utf-8?B?aGlyc2No?= Microsoft Excel Misc 2 16th Apr 2006 10:55 PM
Single column showing cumulative probability of all results with same value Lon Microsoft Excel Charting 0 25th Mar 2006 04:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:59 AM.