ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using Excel as an Adding Machine (https://www.excelbanter.com/excel-discussion-misc-queries/162963-using-excel-adding-machine.html)

preston-ahp

Using Excel as an Adding Machine
 
I am wanting to utilize essentially an adding machine function in an Excel
spreadsheet. I can't, presently, find a way to input a number in a cell, have
it included in a total, and then enter another number to be added to that
recently increased sum (just like an adding machine).

Gord Dibben

Using Excel as an Adding Machine
 
You can do it but what will you do when you make a mistake in entry?

http://www.mcgimpsey.com/excel/accumulator.html


Gord Dibben MS Excel MVP

On Sun, 21 Oct 2007 16:58:01 -0700, preston-ahp
wrote:

I am wanting to utilize essentially an adding machine function in an Excel
spreadsheet. I can't, presently, find a way to input a number in a cell, have
it included in a total, and then enter another number to be added to that
recently increased sum (just like an adding machine).



T. Valko

Using Excel as an Adding Machine
 
You can do it but what will you do when you make a mistake in entry?

Cuss real loud then start over!


--
Biff
Microsoft Excel MVP


"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
You can do it but what will you do when you make a mistake in entry?

http://www.mcgimpsey.com/excel/accumulator.html


Gord Dibben MS Excel MVP

On Sun, 21 Oct 2007 16:58:01 -0700, preston-ahp
wrote:

I am wanting to utilize essentially an adding machine function in an Excel
spreadsheet. I can't, presently, find a way to input a number in a cell,
have
it included in a total, and then enter another number to be added to that
recently increased sum (just like an adding machine).





Roger Govier[_3_]

Using Excel as an Adding Machine
 
Hi

Below is a response I posted to another similar question recently.
The poster wanted to accumulate data over the month . The total appeared in
cell B3, and they were entering data in the cell below this. Column A showed
the date.
You may be able to modify this to suit your needs

original post

Please take good note of all the warnings given about using a single cell
accumulator.

The following code will give the "appearance" of what you want, whilst
maintaining an audit trail of all values entered.
Using a change event code on the worksheet, will add the value entered in
Cells B4:B34 in B3.
It will then hide row 4, fill in the next date in A5 and B5 will be the next
row to enter data.
Each time you enter a value, the same procedure will occur, so you are
always entering you new data immediately below cell B3, but it's actual
location will keep changing.

Format cell A3 FormatCellsNumberCustommmmm
Enter in cell B3 = SUM(B4:B34)
At the end of the month, mark rows 3:35Right clickUnhide.
Mark cells A4:B35Delete and this will clear down all of the data for the
month. Enter a new Month date in cell A3 and start all over again.

At any time, you can unhide the rows and view all of the data that has been
entered. When you have finished looking, just hide rows 4 through to the
last row where data has been entered in column B.

Copy the code belowright click on your sheet tabView codePaste the code
into the white pane.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim lrow As Long
lrow = Cells(Rows.Count, "B").End(xlUp).Row
If Target.Count 1 Then Exit Sub
If Target.Row < 4 Then Exit Sub
If Target.Column < 2 Then Exit Sub

If Target.Value = 0 Then

Select Case MsgBox _
("Did you mean to enter a value of Zero?", _
vbYesNo Or vbQuestion Or vbDefaultButton1, _
"Zero Value Entered")

Case vbYes

Case vbNo
Target.Value = ""
Cells(lrow + 1, 2).Select
Exit Sub

End Select

End If
Application.ScreenUpdating = False
Application.EnableEvents = False

Cells(lrow, 1) = Format(Cells(3, 1) + lrow - 4, "dd-mmm")
Cells(lrow + 1, 1) = Format(Cells(3, 1) + lrow - 3, "dd-mmm")
Cells(lrow, 1).EntireRow.Hidden = True
Cells(lrow + 1, 2).Select
endsub:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub


--
Regards
Roger Govier



"preston-ahp" wrote in message
...
I am wanting to utilize essentially an adding machine function in an Excel
spreadsheet. I can't, presently, find a way to input a number in a cell,
have
it included in a total, and then enter another number to be added to that
recently increased sum (just like an adding machine).





All times are GMT +1. The time now is 09:46 PM.

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