Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Harlan - point well taken. However, your code throws an error when trying to
change any cell BUT B2 Instead of If Intersect(Target, Range("B2")).Cells.Count = 1 Then maybe If Intersect(Target, Range("B2")) Is Nothing Then Exit Sub "Harlan Grove" wrote: Duke Carey wrote... At a minimum you will need to use 2 cells and a worksheet change macro. However, you lose detail and your audit trail by doing this. .... Picky technical response. I agree about the audit trail, but this repsonse is limited to the technical issue of using a cell as an accumulator. It doesn't require two cells. It only requires trickery. To treat cell B2 as an accumulator all it takes is something like this. Private Sub Worksheet_Change(ByVal Target As Range) Dim t As Variant If Intersect(Target, Range("B2")).Cells.Count = 1 Then Set Target = Range("B2") Else Exit Sub End If On Error Resume Next Application.EnableEvents = False t = Target.Value Application.Undo Target.Value = Target.Value + t If Err.Number < 0 Then Target.Value = t Err.Clear Application.EnableEvents = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Linkage data between two spreadsheet | Excel Worksheet Functions | |||
Delay to startup excel spreadsheet | Excel Worksheet Functions | |||
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) | Excel Worksheet Functions | |||
Applying Existing Password to New Spreadsheet | Excel Discussion (Misc queries) | |||
Updating 1 spreadsheet from another | Excel Worksheet Functions |