Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Update totals

I have a sheet which contains data about certain parts of our office. The
data is in range B2:F32.

The data is numeric.

What I would like to do, if possible, is the following:

B2 contains 94, the user wants to add 37 to it by typing 37 over the 94, hit
return and the new total of 131 should appear.

Many thanks in advance.

Cheryl


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Update totals

Right click on the sheet tab and select view code. Put is code similar to
this:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo ErrHandler
If Target.Count = 1 Then
If Not Intersect(Target, Range("B2:F32")) Is Nothing Then
If IsNumeric(Target) Then
dblVal = Target.Value
Application.EnableEvents = False
Application.Undo
Target.Value = Target.Value + dblVal
End If
End If
End If

ErrHandler:
Application.EnableEvents = True
End Sub

they would need to enter a negative number to correct mistakes.

--
Regards,
Tom Ogilvy



Gareth wrote in message
...
I have a sheet which contains data about certain parts of our office. The
data is in range B2:F32.

The data is numeric.

What I would like to do, if possible, is the following:

B2 contains 94, the user wants to add 37 to it by typing 37 over the 94,

hit
return and the new total of 131 should appear.

Many thanks in advance.

Cheryl




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
Pivot Totals: Group totals different from Grand totals PsyberFox Excel Discussion (Misc queries) 1 February 13th 08 06:16 PM
HOW DO I GET COLUMN TOTALS TO AUTO UPDATE? SBL New Users to Excel 2 August 27th 07 09:32 PM
update Totals using current date BrianMcC Excel Discussion (Misc queries) 1 March 10th 07 12:16 PM
How to make autosum update totals in excel Miranda Excel Worksheet Functions 3 February 2nd 06 06:14 AM
My formula doesn't update totals when I change numbers. Ozymandias Excel Discussion (Misc queries) 3 October 23rd 05 10:28 PM


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