Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default help with spreadsheet calculations

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


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
Linkage data between two spreadsheet vitality Excel Worksheet Functions 2 September 15th 05 06:49 AM
Delay to startup excel spreadsheet Gee Excel Worksheet Functions 2 August 2nd 05 07:30 PM
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) RICHARD Excel Worksheet Functions 1 March 15th 05 05:49 PM
Applying Existing Password to New Spreadsheet Vic Excel Discussion (Misc queries) 1 January 27th 05 12:37 AM
Updating 1 spreadsheet from another Sal Excel Worksheet Functions 4 December 17th 04 11:03 PM


All times are GMT +1. The time now is 04:08 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"