LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
jrambo63
 
Posts: n/a
Default Adding an accumulator for multiple cells

From this group I learned to add a single cell accumulator using the
code on http://www.mcgimpsey.com/excel=AD/accumulator.html

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Static dAccumulator As Double
With Target
If .Address(False, False) =3D "A1" Then
If Not IsEmpty(.Value) And IsNumeric(.Value) Then
dAccumulator =3D dAccumulator + .Value
Else
dAccumulator =3D 0
End If
Application.EnableEvents =3D False
.Value =3D dAccumulator
Application.EnableEvents =3D True
End If
End With
End Sub


I was able to get it working for the cell I needed "C8" instead of
"A1", but I would like it running on multiple cells (all running an
accumulator). What do I need to change in the code to accomplish this?

The cells I need this for are C8 through O8 & C9 through O9

Thanks!

 
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
Adding colour to a range of cells based on one of the cells v... McKenna Excel Discussion (Misc queries) 4 March 11th 05 02:25 PM
adding cells that contain formulas that have returned error messag Daniel R Excel Worksheet Functions 3 February 21st 05 07:14 PM
Adding contents of cells by clicking in Excel 2002 Kevin Gordon Excel Discussion (Misc queries) 7 January 11th 05 04:49 PM
ADDING SUM TOTAL OF MORE THAN 30 CELLS IN A COLUMN TOGETHER - WON. Robin Smith Excel Discussion (Misc queries) 0 December 20th 04 08:47 PM
ADDING CELLS WHICH ARE <> THAN OTHER CELLS boogie Excel Worksheet Functions 2 November 25th 04 02:41 PM


All times are GMT +1. The time now is 03:07 PM.

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"