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: 18
Default matching duplicates then looking up corresponding amounts

Hi,
put this code in a module and save it as an *.xla.


Function vertSUM(aTable As Range, aCell As Range) As double
Dim tmp As Range
Dim A As Integer

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

Do
vertSUM = vertSUM + tmp.Offset(, 1).Value
Set tmp = aTable.Find(aCell.Text, tmp, LookIn:=xlValues)
If tmp Is Nothing Then Exit Function
Loop While tmp.Row < A

End If

End Function


let me know,
Regards,
stefano

 
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
Matching check to payment amounts Donna[_2_] Excel Worksheet Functions 7 August 29th 09 03:30 AM
Need to find matching criteria in 1 column, then add amounts in a HeatherJ Excel Worksheet Functions 4 November 11th 08 01:51 AM
Matching columns and removing duplicates Adam Excel Worksheet Functions 10 April 17th 08 10:09 AM
matching values in columns that contain duplicates jellybean Excel Discussion (Misc queries) 8 August 15th 06 02:13 AM
matching dupliclates and then looking up the corresponding amounts Dklunchoo Excel Discussion (Misc queries) 1 September 14th 05 01:24 AM


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