Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Dave
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 "dave" wrote in message ... i want to do this in two rows. Row b3 and b4 not a flowing sheet. I want to enter daliy sales each day to b3 and have a running balance add to b4. tried =sum b3:b4 did not work. If i sell $2 on October 1 I want b3 and b4 to say $2. On october 2 I want to enter $3 daliy sales in b3 and have b4 say $5 and I want to do that over and over every day of month. I would save each day and rename each day and start fresh every first of month . Thanks "Pranav Vaidya" wrote: Hi Dave, I am not usre how is your spreadsheet designed. Assuming that your balance is in cell A1 and daily sales in cell B1, enter the below formula in cell A3, A4, A5... onwards =B2+A2 Drag this formula till your desired range. I am assuming that row 1 is headings row. Hope this helps!! -- Pranav Vaidya VBA Developer PN, MH-India If you think my answer is useful, please rate this post as an ANSWER!! "dave" wrote: I want to enter a days sales then have it keep a running balance, then enter over that days sales and have it add to the running balance. b3 b4 $2 $2 then enter next day $2 over b3 have b4 be $4 and over and over for entire month |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
daily cash report | Excel Worksheet Functions | |||
Keeping my cash expenses from subtracting the cash balance | New Users to Excel | |||
I need an excel template for "Petty Cash Report" | Excel Discussion (Misc queries) | |||
petty cash report | Excel Discussion (Misc queries) | |||
Cash report template | Excel Discussion (Misc queries) |