LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
ste ste is offline
external usenet poster
 
Posts: 6
Default Sum Unique Values Across SpecialCellType Visible Range.

Hi, this is a function I use in one of my add-ins



Function vertSUM(aTable As Range, aCell As Range, Offset As Integer) As
Double
Dim tmp As Range
Dim A As Long

Set tmp = aTable.Find(aCell.Text, LookIn:=xlValues, Lookat:=xlWhole)
If Not tmp Is Nothing Then
A = tmp.Row

Do
vertSUM = vertSUM + tmp.Offset(, Offset).Value

Set tmp = aTable.Find(aCell.Text, tmp, LookIn:=xlValues,
Lookat:=xlWhole)
If tmp Is Nothing Then Exit Function
Loop While tmp.Row < A

End If

End Function


-----------------------

A B
1 a =vertsum($A$7:$B$10;$A1;1) '
2
3
4
5
6 ID VALUE 'values you can filter
7 a 2
8 b 2
9 a 2
10 b 2


Regards,
ste

 
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
Counting the number of unique values within a range SiH23 Excel Discussion (Misc queries) 5 October 30th 08 06:36 PM
count unique values in a filtered range ChrisR Excel Worksheet Functions 2 July 1st 08 07:02 PM
Unique values from date range tqm1 Excel Discussion (Misc queries) 1 June 28th 07 08:04 AM
How do I get the unique values from a range? DaveO Excel Worksheet Functions 13 January 13th 06 12:55 AM
Display unique values in a range. future Excel Programming 5 January 29th 04 11:24 PM


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