jrevans778
New Member
- Joined
- Apr 24, 2018
- Messages
- 3
Hello! First, I want to say how much I appreciate this community... it's been a huge help with my Excel questions!
Input data example
[TABLE="width: 683"]
<tbody>[TR]
[TD]Customer Name[/TD]
[TD]Date[/TD]
[TD]Product[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]1/24/2016[/TD]
[TD]Paint, Standard Green[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1/24/2016[/TD]
[TD]Shelf, H1[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1/24/2016[/TD]
[TD]Backer, H1[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]5/14/2016[/TD]
[TD]Shelf, H1[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]5/14/2016[/TD]
[TD]Backer, H1[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]5/14/2016[/TD]
[TD]Paint, Standard Red[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]5/14/2016[/TD]
[TD]Towels, Small[/TD]
[TD]17[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]Total[/TD]
[TD][/TD]
[TD]42[/TD]
[/TR]
[TR]
[TD]James Jackson[/TD]
[TD]2/4/2016[/TD]
[TD]Towels, Large[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/4/2016[/TD]
[TD]Towels, Small[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/4/2016[/TD]
[TD]Towels, Med[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/4/2016[/TD]
[TD]Paint, Standard Red[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/4/2016[/TD]
[TD]Paint, Standard Green[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/5/2016[/TD]
[TD]Labels, SZ2, 120ct[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/5/2016[/TD]
[TD]Pen, black, 200ct[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]James Jackson[/TD]
[TD]Total[/TD]
[TD][/TD]
[TD]41[/TD]
[/TR]
</tbody>[/TABLE]
Desired output
[TABLE="width: 962"]
<tbody>[TR]
[TD][/TD]
[TD]Paint, Standard Green[/TD]
[TD]Paint, Standard Red[/TD]
[TD]Shelf, H1[/TD]
[TD]Backer, H1[/TD]
[TD]Towels, Small[/TD]
[TD]Towels, Med[/TD]
[TD]Towels, Large[/TD]
[TD]Labels, SZ2, 120ct[/TD]
[TD]Pen, black, 200ct[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]10[/TD]
[TD]10[/TD]
[TD]17[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]James Jackson[/TD]
[TD]4[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]12[/TD]
[TD]6[/TD]
[TD]12[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD]6[/TD]
[TD]4[/TD]
[TD]10[/TD]
[TD]10[/TD]
[TD]29[/TD]
[TD]6[/TD]
[TD]12[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
The input data is posted from a report and the columns will always be the same but obviously the rest of the data will vary. I want to create a macro using vba to convert the input data to the desired format. I'm thinking I'd need to loop through the products per customer and total each in a variable but I'm not really sure how to start this.
ANY assistance would be GREATLY appreciated!
Input data example
[TABLE="width: 683"]
<tbody>[TR]
[TD]Customer Name[/TD]
[TD]Date[/TD]
[TD]Product[/TD]
[TD]QTY[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]1/24/2016[/TD]
[TD]Paint, Standard Green[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1/24/2016[/TD]
[TD]Shelf, H1[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1/24/2016[/TD]
[TD]Backer, H1[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]5/14/2016[/TD]
[TD]Shelf, H1[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]5/14/2016[/TD]
[TD]Backer, H1[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]5/14/2016[/TD]
[TD]Paint, Standard Red[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]5/14/2016[/TD]
[TD]Towels, Small[/TD]
[TD]17[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]Total[/TD]
[TD][/TD]
[TD]42[/TD]
[/TR]
[TR]
[TD]James Jackson[/TD]
[TD]2/4/2016[/TD]
[TD]Towels, Large[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/4/2016[/TD]
[TD]Towels, Small[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/4/2016[/TD]
[TD]Towels, Med[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/4/2016[/TD]
[TD]Paint, Standard Red[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/4/2016[/TD]
[TD]Paint, Standard Green[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/5/2016[/TD]
[TD]Labels, SZ2, 120ct[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/5/2016[/TD]
[TD]Pen, black, 200ct[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]James Jackson[/TD]
[TD]Total[/TD]
[TD][/TD]
[TD]41[/TD]
[/TR]
</tbody>[/TABLE]
Desired output
[TABLE="width: 962"]
<tbody>[TR]
[TD][/TD]
[TD]Paint, Standard Green[/TD]
[TD]Paint, Standard Red[/TD]
[TD]Shelf, H1[/TD]
[TD]Backer, H1[/TD]
[TD]Towels, Small[/TD]
[TD]Towels, Med[/TD]
[TD]Towels, Large[/TD]
[TD]Labels, SZ2, 120ct[/TD]
[TD]Pen, black, 200ct[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]10[/TD]
[TD]10[/TD]
[TD]17[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]James Jackson[/TD]
[TD]4[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]12[/TD]
[TD]6[/TD]
[TD]12[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD]6[/TD]
[TD]4[/TD]
[TD]10[/TD]
[TD]10[/TD]
[TD]29[/TD]
[TD]6[/TD]
[TD]12[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
The input data is posted from a report and the columns will always be the same but obviously the rest of the data will vary. I want to create a macro using vba to convert the input data to the desired format. I'm thinking I'd need to loop through the products per customer and total each in a variable but I'm not really sure how to start this.
ANY assistance would be GREATLY appreciated!