I'm trying to create VBA code (or functions if possible) that will identify all matching entries in column A and then total the values in a range from columns B through E from the rows with the matching entries, and then continue on to the next set of matching entries in column A.
For example, the code would identify that the column A cells values A2, A3, and A4 match, total the values in range B2:E4, and enter the total in cell F2 (or F4). The code then would continue down column A identifying that cells A5 and A6 match, total the values in range B5:E6, and enter the total in cell F5 (or F6). And so on... The entries in column A will be sorted so like entries are always in order. See example below (the different colors are just for emphasis).
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>[TABLE="width: 0"]
<colgroup><col style="width: 123px"><col width="123"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup><tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD]Company Name[/TD]
[TD="align: center"]Quantity 1[/TD]
[TD="align: center"]Quantity 2[/TD]
[TD="align: center"]Quantity 3[/TD]
[TD="align: center"]Quantity 4[/TD]
[TD="align: center"]Total[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]ABC[/TD]
[TD="align: center"][TABLE="width: 0"]
<tbody>[TR]
[TD="align: center"]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]10[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]ABC[/TD]
[TD][/TD]
[TD="align: center"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD]ABC[/TD]
[TD="align: center"]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD]EFG[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD="align: center"]11[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD]EFG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]7[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD]RST[/TD]
[TD="align: center"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]19[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD]RST[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]9[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD]RST[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD]RST[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD]UVW[/TD]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]4[/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD]XYZ[/TD]
[TD][/TD]
[TD="align: center"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]5[/TD]
[/TR]
</tbody>[/TABLE]
For example, the code would identify that the column A cells values A2, A3, and A4 match, total the values in range B2:E4, and enter the total in cell F2 (or F4). The code then would continue down column A identifying that cells A5 and A6 match, total the values in range B5:E6, and enter the total in cell F5 (or F6). And so on... The entries in column A will be sorted so like entries are always in order. See example below (the different colors are just for emphasis).
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>[TABLE="width: 0"]
<colgroup><col style="width: 123px"><col width="123"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup><tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD]Company Name[/TD]
[TD="align: center"]Quantity 1[/TD]
[TD="align: center"]Quantity 2[/TD]
[TD="align: center"]Quantity 3[/TD]
[TD="align: center"]Quantity 4[/TD]
[TD="align: center"]Total[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]ABC[/TD]
[TD="align: center"][TABLE="width: 0"]
<tbody>[TR]
[TD="align: center"]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]10[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]ABC[/TD]
[TD][/TD]
[TD="align: center"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD]ABC[/TD]
[TD="align: center"]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD]EFG[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD="align: center"]11[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD]EFG[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]7[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD]RST[/TD]
[TD="align: center"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]19[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD]RST[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]9[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD]RST[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD]RST[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD]UVW[/TD]
[TD="align: center"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]4[/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD]XYZ[/TD]
[TD][/TD]
[TD="align: center"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]5[/TD]
[/TR]
</tbody>[/TABLE]