LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default HELP! Almost got it..Summing numbers between


I'm trying to sum numbers between non zero's but when there ar
multiples in rows it doesn't work. For example row 5 should sum to
and row 6 should sum to 12(1+8+3). However with the code I have belo
rows 5 and 6 are both summing to 16 (4+1+8+3). Please help!!

Thanks
Trevor
Eg.
1 0 3
2 Yes 2
3 0 5
4 0 2
5 Yes 6
6 Yes 4
7 0 1
8 0 8
9 0 3
10 Yes 2


Sub SumBetween()
' This macro sums the differences between Yes's
' Macro1 Macro
' Macro recorded 22-08-2005

'Clears column V, sum of the differences
Sheets("WorkPage").Select
Columns("V:V").Select
Selection.ClearContents

'Sets ranges to column P then formats to formula and text cell
Set rng = Columns(16).SpecialCells(xlFormulas, xlTextValues)
i = 0
For Each ar In rng.Areas
i = i + 1
If i < 1 Then
Set rng1 = Range(cell.Offset(1, 4), ar.Offset(-1, 4))
cell.Offset(0, 6).Value = Abs(Application.Sum(rng1))
End If
Set cell = ar
Next
MinAdd (myAdd)
MinPower
Calculate
End Su

--
Tre_coo
-----------------------------------------------------------------------
Tre_cool's Profile: http://www.excelforum.com/member.php...fo&userid=2641
View this thread: http://www.excelforum.com/showthread.php?threadid=47792

 
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
Summing numbers Gingit Excel Discussion (Misc queries) 2 October 7th 06 12:31 AM
Keep getting #### when summing numbers Ammy Excel Discussion (Misc queries) 2 June 15th 06 06:40 AM
summing more than 30 numbers stevientx Excel Discussion (Misc queries) 5 March 10th 06 02:36 PM
summing numbers David Bateman Excel Programming 1 March 8th 05 06:05 PM
Summing Numbers Dave C. Excel Discussion (Misc queries) 1 February 24th 05 03:56 PM


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