Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default displaying running total of value entered in same cell?

I want to allow the user to type an Integer value into a worksheet cell. The
cell value is added to the previous cell entries from that same cell and
displayed in a linked cell on a separate worksheet.

If possible, all values for previous weeks entries on the worksheet can be
retrieved and displayed without the need to store each spreadsheet as a
separate file.

Any help on this would be grealty appreciated
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default displaying running total of value entered in same cell?

Hi,

Right click your sheet tab, view code and psate this in. It takes the calue
from A1 and accumullates those values in sheet2 A2. Accepts integer values
only

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Address = "$A$1" And IsNumeric(Target) And _
Target.Value - Int(Target.Value) = 0 Then
Sheets("Sheet2").Range("A2").Value _
= Sheets("Sheet2").Range("A2").Value + Target.Value
End If
End Sub

Mike

"Colin Fisher" wrote:

I want to allow the user to type an Integer value into a worksheet cell. The
cell value is added to the previous cell entries from that same cell and
displayed in a linked cell on a separate worksheet.

If possible, all values for previous weeks entries on the worksheet can be
retrieved and displayed without the need to store each spreadsheet as a
separate file.

Any help on this would be grealty appreciated

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default displaying running total of value entered in same cell?

An accumulator cell idea is risky idea. Mistakes are difficult to find and
correct.

Having said that, here is a method you can try.

Add this event code to the sheet with the entry cell at A1

Add a new sheet named Retriever

You can hide that sheet if you wish. It is just used to collect the entries
made in A1

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'accumulator/summer
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$A$1" And Target.Value < "" Then
Sheets("Retriever").Cells(Rows.Count, "A").End(xlUp) _
.Offset(1, 0).Value = Target.Value
End If
stoppit:
Application.EnableEvents = True
End Sub

In whatever cell on the "separate worksheet" you want the accumulated value
enter =SUM(Retriever!A2:A1000)

If user makes a mistake you at least have a list of all entries to peruse.

Note: to correct a mistake, you will have enter a negative number to
subtract the mistake from the SUM formula.



Gord Dibben MS Excel MVP

On Sun, 18 Jan 2009 06:22:07 -0800, Colin Fisher <Colin
wrote:

I want to allow the user to type an Integer value into a worksheet cell. The
cell value is added to the previous cell entries from that same cell and
displayed in a linked cell on a separate worksheet.

If possible, all values for previous weeks entries on the worksheet can be
retrieved and displayed without the need to store each spreadsheet as a
separate file.

Any help on this would be grealty appreciated


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default displaying running total of value entered in same cell?


Hi Mike

Thank you for the response. I will give the coding a try. Pehaps if I can be
more specific about the problem, you might know a better way around it.

User is entering several integer values on a table. Each value is to be
added to a sum on another table. Perhaps a method of verification could be
introduced to cut down on the chance of errors in data entry. It would be
helpful if the data for each weeks entries could be retained and displayed by
entering the date for the beginning of that week. Unfortunately the number
of weeks is unknown.

Thanks for the time and effort you have provided me with.

Colin
"Mike H" wrote:

Hi,

Right click your sheet tab, view code and psate this in. It takes the calue
from A1 and accumullates those values in sheet2 A2. Accepts integer values
only

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Address = "$A$1" And IsNumeric(Target) And _
Target.Value - Int(Target.Value) = 0 Then
Sheets("Sheet2").Range("A2").Value _
= Sheets("Sheet2").Range("A2").Value + Target.Value
End If
End Sub

Mike

"Colin Fisher" wrote:

I want to allow the user to type an Integer value into a worksheet cell. The
cell value is added to the previous cell entries from that same cell and
displayed in a linked cell on a separate worksheet.

If possible, all values for previous weeks entries on the worksheet can be
retrieved and displayed without the need to store each spreadsheet as a
separate file.

Any help on this would be grealty appreciated



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default displaying running total of value entered in same cell?

Gord

Many thanks for the time you put into coming up with a possible solution. I
will be giving it a try. I do need for the user to be able to view
historical data that has been entered. Your method should facilitate this.

Colin


"Gord Dibben" wrote:

An accumulator cell idea is risky idea. Mistakes are difficult to find and
correct.

Having said that, here is a method you can try.

Add this event code to the sheet with the entry cell at A1

Add a new sheet named Retriever

You can hide that sheet if you wish. It is just used to collect the entries
made in A1

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'accumulator/summer
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$A$1" And Target.Value < "" Then
Sheets("Retriever").Cells(Rows.Count, "A").End(xlUp) _
.Offset(1, 0).Value = Target.Value
End If
stoppit:
Application.EnableEvents = True
End Sub

In whatever cell on the "separate worksheet" you want the accumulated value
enter =SUM(Retriever!A2:A1000)

If user makes a mistake you at least have a list of all entries to peruse.

Note: to correct a mistake, you will have enter a negative number to
subtract the mistake from the SUM formula.



Gord Dibben MS Excel MVP

On Sun, 18 Jan 2009 06:22:07 -0800, Colin Fisher <Colin
wrote:

I want to allow the user to type an Integer value into a worksheet cell. The
cell value is added to the previous cell entries from that same cell and
displayed in a linked cell on a separate worksheet.

If possible, all values for previous weeks entries on the worksheet can be
retrieved and displayed without the need to store each spreadsheet as a
separate file.

Any help on this would be grealty appreciated



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default displaying running total of value entered in same cell?

Thanks for the feedback.

With a slight change you can also get date and time of each entry.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'accumulator/summer
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$A$1" And Target.Value < "" Then
With Sheets("Retriever").Cells(Rows.Count, "A").End(xlUp) _
.Offset(1, 0)
.Value = Target.Value
.Offset(0, 1).Value = Now
End With
End If
stoppit:
Application.EnableEvents = True
End Sub


Gord

On Wed, 21 Jan 2009 11:39:01 -0800, Colin Fisher
wrote:

Gord

Many thanks for the time you put into coming up with a possible solution. I
will be giving it a try. I do need for the user to be able to view
historical data that has been entered. Your method should facilitate this.

Colin


"Gord Dibben" wrote:

An accumulator cell idea is risky idea. Mistakes are difficult to find and
correct.

Having said that, here is a method you can try.

Add this event code to the sheet with the entry cell at A1

Add a new sheet named Retriever

You can hide that sheet if you wish. It is just used to collect the entries
made in A1

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'accumulator/summer
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$A$1" And Target.Value < "" Then
Sheets("Retriever").Cells(Rows.Count, "A").End(xlUp) _
.Offset(1, 0).Value = Target.Value
End If
stoppit:
Application.EnableEvents = True
End Sub

In whatever cell on the "separate worksheet" you want the accumulated value
enter =SUM(Retriever!A2:A1000)

If user makes a mistake you at least have a list of all entries to peruse.

Note: to correct a mistake, you will have enter a negative number to
subtract the mistake from the SUM formula.



Gord Dibben MS Excel MVP

On Sun, 18 Jan 2009 06:22:07 -0800, Colin Fisher <Colin
wrote:

I want to allow the user to type an Integer value into a worksheet cell. The
cell value is added to the previous cell entries from that same cell and
displayed in a linked cell on a separate worksheet.

If possible, all values for previous weeks entries on the worksheet can be
retrieved and displayed without the need to store each spreadsheet as a
separate file.

Any help on this would be grealty 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
Updating a Running total from a cell MacPack2 New Users to Excel 1 April 11th 08 06:26 PM
How can I make a running total change in a new cell Meenie Excel Worksheet Functions 3 April 7th 08 07:48 PM
Running total within a cell bob2525 Excel Worksheet Functions 3 October 4th 06 11:34 PM
Is there any way of calculating a running total within a single cell in a column Janev New Users to Excel 2 September 13th 06 01:22 PM
keeping a running total in a single cell shrtdawg73 Excel Worksheet Functions 10 August 23rd 06 12:17 AM


All times are GMT +1. The time now is 11:19 PM.

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

About Us

"It's about Microsoft Excel"