Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Adding up within a cell during data input

Hi, I wonder if anyone could help with a query I have around data input.

I'm working on spreadsheets recording stats we receive daily, calculating
the totals on a calculator and then overwriting the existing number. For
example, if the cell shows '200' and our daily feed brings out an increase of
45, I am manually entering '245'.

I know it is possible to enter the data by formula, so instead of overtyping
'245' I have been entering '=200+45'. What I would like to know is if there
is a way of simply entering '45' into the cell and have excel automatically
add it to what number is already there. Is it possible to do this?

Thanks in advance for any advice!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Adding up within a cell during data input

This example uses cell B9 as an accumulator.

Put the following code in a standard module

Public buildup As Variant
Sub StartMe()
buildup = Range("B9").Value
Application.EnableEvents = True
End Sub

Next put the following code in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set b9 = Range("B9")
Set t = Target
If Intersect(t, b9) Is Nothing Then Exit Sub
Application.EnableEvents = False
b9.Value = b9.Value + buildup
buildup = b9.Value
Application.EnableEvents = True
End Sub

Then run StartMe.
Then start typing values in cell B9.
--
Gary''s Student - gsnu200810


"purelycreativeadam" wrote:

Hi, I wonder if anyone could help with a query I have around data input.

I'm working on spreadsheets recording stats we receive daily, calculating
the totals on a calculator and then overwriting the existing number. For
example, if the cell shows '200' and our daily feed brings out an increase of
45, I am manually entering '245'.

I know it is possible to enter the data by formula, so instead of overtyping
'245' I have been entering '=200+45'. What I would like to know is if there
is a way of simply entering '45' into the cell and have excel automatically
add it to what number is already there. Is it possible to do this?

Thanks in advance for any advice!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Adding up within a cell during data input

Hi Gary

Thanks for the help. As Im unfamiliar with the code editor, I may need to
ask some further questions - do you know if it is possible to apply this to a
range of cells?

"Gary''s Student" wrote:

This example uses cell B9 as an accumulator.

Put the following code in a standard module

Public buildup As Variant
Sub StartMe()
buildup = Range("B9").Value
Application.EnableEvents = True
End Sub

Next put the following code in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set b9 = Range("B9")
Set t = Target
If Intersect(t, b9) Is Nothing Then Exit Sub
Application.EnableEvents = False
b9.Value = b9.Value + buildup
buildup = b9.Value
Application.EnableEvents = True
End Sub

Then run StartMe.
Then start typing values in cell B9.
--
Gary''s Student - gsnu200810


"purelycreativeadam" wrote:

Hi, I wonder if anyone could help with a query I have around data input.

I'm working on spreadsheets recording stats we receive daily, calculating
the totals on a calculator and then overwriting the existing number. For
example, if the cell shows '200' and our daily feed brings out an increase of
45, I am manually entering '245'.

I know it is possible to enter the data by formula, so instead of overtyping
'245' I have been entering '=200+45'. What I would like to know is if there
is a way of simply entering '45' into the cell and have excel automatically
add it to what number is already there. Is it possible to do this?

Thanks in advance for any advice!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Adding up within a cell during data input

Yes - But the code would need some modifications.
--
Gary''s Student - gsnu200810


"purelycreativeadam" wrote:

Hi Gary

Thanks for the help. As Im unfamiliar with the code editor, I may need to
ask some further questions - do you know if it is possible to apply this to a
range of cells?

"Gary''s Student" wrote:

This example uses cell B9 as an accumulator.

Put the following code in a standard module

Public buildup As Variant
Sub StartMe()
buildup = Range("B9").Value
Application.EnableEvents = True
End Sub

Next put the following code in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set b9 = Range("B9")
Set t = Target
If Intersect(t, b9) Is Nothing Then Exit Sub
Application.EnableEvents = False
b9.Value = b9.Value + buildup
buildup = b9.Value
Application.EnableEvents = True
End Sub

Then run StartMe.
Then start typing values in cell B9.
--
Gary''s Student - gsnu200810


"purelycreativeadam" wrote:

Hi, I wonder if anyone could help with a query I have around data input.

I'm working on spreadsheets recording stats we receive daily, calculating
the totals on a calculator and then overwriting the existing number. For
example, if the cell shows '200' and our daily feed brings out an increase of
45, I am manually entering '245'.

I know it is possible to enter the data by formula, so instead of overtyping
'245' I have been entering '=200+45'. What I would like to know is if there
is a way of simply entering '45' into the cell and have excel automatically
add it to what number is already there. Is it possible to do this?

Thanks in advance for any advice!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
data input into cell a1 drives c1 data gathered from a list petlover Charts and Charting in Excel 0 June 11th 07 10:23 PM
refilling data in same cell after user input in another cell H. Singh Excel Discussion (Misc queries) 7 April 24th 07 12:48 PM
Compare Data on Two Spreadsheets to Put Input Into One Cell Rob Excel Worksheet Functions 2 April 21st 07 08:02 PM
Data input to one cell? Potaroo New Users to Excel 1 April 17th 07 12:38 AM
Input Cell in One variable data table Dottore Magistrale Excel Worksheet Functions 0 August 30th 05 06:25 PM


All times are GMT +1. The time now is 07:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"