Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default Auto Sum entries in a cell

Hi, let's say I entered 5 in A1 and then the next day I updated the cell to
6. Can Excel total these two entries in A1 to get a total of 11. I don't
want to use a separate cell to add up each entry.

Your help is greatly appreciated
--
Regards
Mike
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Auto Sum entries in a cell

Mike,

Add this to a standard module

Option Explicit
Public myValue As Double


Add these two to the worksheet's codemodule

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.EnableEvents = False
Target.Value = Target.Value + myValue
myValue = Target.Value
Application.EnableEvents = True
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$1" Then myValue = Target.Value
End Sub


Add this to the workbook's code module, changing the Sheet1 to the correct sheet name:

Private Sub Workbook_Open()
myValue = Worksheets("Sheet1").Range("A1").Value
End Sub

HTH,
Bernie
MS Excel MVP


"Mike" wrote in message
...
Hi, let's say I entered 5 in A1 and then the next day I updated the cell to
6. Can Excel total these two entries in A1 to get a total of 11. I don't
want to use a separate cell to add up each entry.

Your help is greatly appreciated
--
Regards
Mike



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Auto Sum entries in a cell

Mike

Bernie's code will do the job, but you will have no "audit trail" in the
event of incorrect data input.

This can lead to problems.


Gord Dibben MS Excel MVP

On Fri, 25 Jul 2008 06:29:03 -0700, Mike
wrote:

Hi, let's say I entered 5 in A1 and then the next day I updated the cell to
6. Can Excel total these two entries in A1 to get a total of 11. I don't
want to use a separate cell to add up each entry.

Your help is greatly appreciated


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
How can cell entries be based on word entries in another cell ? lifewings Excel Worksheet Functions 1 June 24th 08 05:45 PM
Auto suggest entries? Manju Excel Worksheet Functions 6 January 12th 07 06:20 PM
Auto-numbering new row entries CW Excel Discussion (Misc queries) 2 December 20th 06 11:14 PM
It auto changes font size on e-mail entries, WHY? donnaemi Excel Discussion (Misc queries) 2 July 27th 05 02:21 PM
auto change number entries ToddG Excel Worksheet Functions 2 April 25th 05 01:46 PM


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

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"