Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
This is only a small part of the spreadsheet I have a component Name in Column C2:C20 and quantity in Column D2:D20. ColumnC can contain many components of the same name. I have managed with VBA code ( Thanks to Colo's Excel Junk Room) to put all unique component names in ColumnC starting at C22. What I can't seem to be able to do is sum the unique totals from D2:D20 for the unique names for Column D starting at D22 The code below works for individual Names. There are a possible 150 part names so I reckon that there would be a way with a For... Each... routine or a loop. But, I can't get either of them to produce the correct result. Also there is no way of knowing what part name will be at what address Can anyone help? Dim cn Dim tally Dim Qty For Each cn In myRange3 If cn = "6T2" Then Qty = cn.Offset(0, 1) tally = tally + a3 End If Next Range("D22").Value = tally Thanks Richard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
Too Many Variables | Excel Worksheet Functions | |||
Using variables . . . | Excel Discussion (Misc queries) | |||
What are my variables ... ? | Excel Programming | |||
Variables | Excel Programming |