I have a large excel spreadsheet where I need to merge rows on a unique identifier. I'm trying to develop an Excel VBA macro but still lack the proficiency to tackle this.
Here is a picture of an example of what I'm trying to do. The data including the headers are all made up for the example but what is demonstrated down below is exactly what I'm trying to do.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]EXAMPLE DATA[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BEFORE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Unique ID[/TD]
[TD]Item Name[/TD]
[TD]Item Description[/TD]
[TD]Numbers Sold[/TD]
[TD]Notes[/TD]
[/TR]
[TR]
[TD]11111[/TD]
[TD]Cupcakes[/TD]
[TD]Red[/TD]
[TD]10[/TD]
[TD]Good[/TD]
[/TR]
[TR]
[TD]11111[/TD]
[TD]Cupcakes[/TD]
[TD]Red[/TD]
[TD]15[/TD]
[TD]Testing[/TD]
[/TR]
[TR]
[TD]11111[/TD]
[TD]Cupcakes[/TD]
[TD]Red[/TD]
[TD]10[/TD]
[TD]Bad[/TD]
[/TR]
[TR]
[TD]22222[/TD]
[TD]Brownies[/TD]
[TD]Brown[/TD]
[TD]11[/TD]
[TD]Example[/TD]
[/TR]
[TR]
[TD]22222[/TD]
[TD]Brownies[/TD]
[TD]Brown[/TD]
[TD]11[/TD]
[TD]Example2[/TD]
[/TR]
[TR]
[TD]22222[/TD]
[TD]Brownies[/TD]
[TD]Brown[/TD]
[TD]26[/TD]
[TD]Example3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AFTER[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Unique ID[/TD]
[TD]Item Name[/TD]
[TD]Item Description[/TD]
[TD]Numbers Sold[/TD]
[TD]Notes[/TD]
[/TR]
[TR]
[TD]11111[/TD]
[TD]Cupcakes[/TD]
[TD]Red[/TD]
[TD]35[/TD]
[TD]Good, Testing, Bad[/TD]
[/TR]
[TR]
[TD]22222[/TD]
[TD]Brownies[/TD]
[TD]Brown[/TD]
[TD]37[/TD]
[TD]Example, Example 2, Example 3[/TD]
[/TR]
</tbody>[/TABLE]
As you can see, similar data is merged together on the first 3 columns based upon the unique ID. The 4th column containing number values are added up. Any unique values in the 5th column are kept together as unique data.
I would appreciate any help or tips anyone can give me. Thank you!
Here is a picture of an example of what I'm trying to do. The data including the headers are all made up for the example but what is demonstrated down below is exactly what I'm trying to do.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]EXAMPLE DATA[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]BEFORE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Unique ID[/TD]
[TD]Item Name[/TD]
[TD]Item Description[/TD]
[TD]Numbers Sold[/TD]
[TD]Notes[/TD]
[/TR]
[TR]
[TD]11111[/TD]
[TD]Cupcakes[/TD]
[TD]Red[/TD]
[TD]10[/TD]
[TD]Good[/TD]
[/TR]
[TR]
[TD]11111[/TD]
[TD]Cupcakes[/TD]
[TD]Red[/TD]
[TD]15[/TD]
[TD]Testing[/TD]
[/TR]
[TR]
[TD]11111[/TD]
[TD]Cupcakes[/TD]
[TD]Red[/TD]
[TD]10[/TD]
[TD]Bad[/TD]
[/TR]
[TR]
[TD]22222[/TD]
[TD]Brownies[/TD]
[TD]Brown[/TD]
[TD]11[/TD]
[TD]Example[/TD]
[/TR]
[TR]
[TD]22222[/TD]
[TD]Brownies[/TD]
[TD]Brown[/TD]
[TD]11[/TD]
[TD]Example2[/TD]
[/TR]
[TR]
[TD]22222[/TD]
[TD]Brownies[/TD]
[TD]Brown[/TD]
[TD]26[/TD]
[TD]Example3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AFTER[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Unique ID[/TD]
[TD]Item Name[/TD]
[TD]Item Description[/TD]
[TD]Numbers Sold[/TD]
[TD]Notes[/TD]
[/TR]
[TR]
[TD]11111[/TD]
[TD]Cupcakes[/TD]
[TD]Red[/TD]
[TD]35[/TD]
[TD]Good, Testing, Bad[/TD]
[/TR]
[TR]
[TD]22222[/TD]
[TD]Brownies[/TD]
[TD]Brown[/TD]
[TD]37[/TD]
[TD]Example, Example 2, Example 3[/TD]
[/TR]
</tbody>[/TABLE]
As you can see, similar data is merged together on the first 3 columns based upon the unique ID. The 4th column containing number values are added up. Any unique values in the 5th column are kept together as unique data.
I would appreciate any help or tips anyone can give me. Thank you!