EquipmentPartsSales
New Member
- Joined
- Sep 17, 2018
- Messages
- 6
I have a large inventory file I am working with. The data looks like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]NSN[/TD]
[TD]Part number[/TD]
[TD]Condition[/TD]
[TD]QTY[/TD]
[TD]DESC[/TD]
[/TR]
[TR]
[TD]1005001950897[/TD]
[TD]11662739[/TD]
[TD]NS[/TD]
[TD]7[/TD]
[TD]MOTOR[/TD]
[/TR]
[TR]
[TD]1005001950897[/TD]
[TD]11662739[/TD]
[TD]NS[/TD]
[TD]2[/TD]
[TD]MOTOR[/TD]
[/TR]
[TR]
[TD]1005002676740[/TD]
[TD]368506201[/TD]
[TD]NS[/TD]
[TD]4[/TD]
[TD]HOUSING[/TD]
[/TR]
[TR]
[TD]1005005013201[/TD]
[TD]5013201[/TD]
[TD]NS[/TD]
[TD]1[/TD]
[TD]SPRING[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Basically what I would like to do is if the number in column NSN has a duplicate then add up the values in the QTY column. For this example it would like like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]NSN[/TD]
[TD]Part number[/TD]
[TD]Condition[/TD]
[TD]QTY[/TD]
[TD]DESC[/TD]
[TD]Total Qty[/TD]
[/TR]
[TR]
[TD]1005001950897[/TD]
[TD]11662739[/TD]
[TD]NS[/TD]
[TD]7[/TD]
[TD]MOTOR[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]1005001950897[/TD]
[TD]11662739[/TD]
[TD]NS[/TD]
[TD]2[/TD]
[TD]MOTOR[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1005002676740[/TD]
[TD]368506201[/TD]
[TD]NS[/TD]
[TD]4[/TD]
[TD]HOUSING[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1005005013201[/TD]
[TD]5013201[/TD]
[TD]NS[/TD]
[TD]1[/TD]
[TD]SPRING[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I do not know if there is a simple formula or a VBA code that will achieve this. My inventory list has roughly 200,000 lines. Any help would be greatly appreciated.
[TABLE="width: 500"]
<tbody>[TR]
[TD]NSN[/TD]
[TD]Part number[/TD]
[TD]Condition[/TD]
[TD]QTY[/TD]
[TD]DESC[/TD]
[/TR]
[TR]
[TD]1005001950897[/TD]
[TD]11662739[/TD]
[TD]NS[/TD]
[TD]7[/TD]
[TD]MOTOR[/TD]
[/TR]
[TR]
[TD]1005001950897[/TD]
[TD]11662739[/TD]
[TD]NS[/TD]
[TD]2[/TD]
[TD]MOTOR[/TD]
[/TR]
[TR]
[TD]1005002676740[/TD]
[TD]368506201[/TD]
[TD]NS[/TD]
[TD]4[/TD]
[TD]HOUSING[/TD]
[/TR]
[TR]
[TD]1005005013201[/TD]
[TD]5013201[/TD]
[TD]NS[/TD]
[TD]1[/TD]
[TD]SPRING[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Basically what I would like to do is if the number in column NSN has a duplicate then add up the values in the QTY column. For this example it would like like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]NSN[/TD]
[TD]Part number[/TD]
[TD]Condition[/TD]
[TD]QTY[/TD]
[TD]DESC[/TD]
[TD]Total Qty[/TD]
[/TR]
[TR]
[TD]1005001950897[/TD]
[TD]11662739[/TD]
[TD]NS[/TD]
[TD]7[/TD]
[TD]MOTOR[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]1005001950897[/TD]
[TD]11662739[/TD]
[TD]NS[/TD]
[TD]2[/TD]
[TD]MOTOR[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1005002676740[/TD]
[TD]368506201[/TD]
[TD]NS[/TD]
[TD]4[/TD]
[TD]HOUSING[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1005005013201[/TD]
[TD]5013201[/TD]
[TD]NS[/TD]
[TD]1[/TD]
[TD]SPRING[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I do not know if there is a simple formula or a VBA code that will achieve this. My inventory list has roughly 200,000 lines. Any help would be greatly appreciated.