I am working with a large amount of data that needs to be combined by RA# and then sub totaled by material number.
[TABLE="width: 839"]
<colgroup><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]RA #[/TD]
[TD]Store #[/TD]
[TD]Material[/TD]
[TD]Customer Material[/TD]
[TD]Order qty[/TD]
[TD]UoM[/TD]
[TD]Return Plant[/TD]
[TD]Box Plant[/TD]
[TD]Production plant[/TD]
[/TR]
[TR]
[TD]60178173[/TD]
[TD]7247[/TD]
[TD]38125ESS[/TD]
[TD="align: right"]14746640086[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60178173[/TD]
[TD]7247[/TD]
[TD]38125ESS[/TD]
[TD="align: right"]14746640086[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60178173[/TD]
[TD]7247[/TD]
[TD]38125ESS[/TD]
[TD="align: right"]14746640086[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60178173[/TD]
[TD]7247[/TD]
[TD]05846AQU[/TD]
[TD="align: right"]14746558466[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60178173[/TD]
[TD]7247[/TD]
[TD]05846AQU[/TD]
[TD="align: right"]14746558466[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60171864[/TD]
[TD]7247[/TD]
[TD]26342BIO[/TD]
[TD="align: right"]17541621557[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60171864[/TD]
[TD]7247[/TD]
[TD]26342BIO[/TD]
[TD="align: right"]17541621557[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60171864[/TD]
[TD]7247[/TD]
[TD]26342BIO[/TD]
[TD="align: right"]17541621557[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON
[/TD]
[/TR]
</tbody>[/TABLE]
After the macro is run the result should match the table below.
[TABLE="width: 422"]
<colgroup><col><col><col><col span="2"></colgroup><tbody>[TR]
[TD]Store[/TD]
[TD]Material[/TD]
[TD]Order qty[/TD]
[TD]UoM[/TD]
[TD]RA #[/TD]
[/TR]
[TR]
[TD]7247[/TD]
[TD]38125ESS[/TD]
[TD="align: right"]3[/TD]
[TD]EA[/TD]
[TD]60178173[/TD]
[/TR]
[TR]
[TD]7247[/TD]
[TD]05846AQU[/TD]
[TD="align: right"]2[/TD]
[TD]EA[/TD]
[TD]60178173[/TD]
[/TR]
[TR]
[TD]7247[/TD]
[TD]26342BIO[/TD]
[TD="align: right"]3[/TD]
[TD]EA[/TD]
[TD]60171864[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 839"]
<colgroup><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]RA #[/TD]
[TD]Store #[/TD]
[TD]Material[/TD]
[TD]Customer Material[/TD]
[TD]Order qty[/TD]
[TD]UoM[/TD]
[TD]Return Plant[/TD]
[TD]Box Plant[/TD]
[TD]Production plant[/TD]
[/TR]
[TR]
[TD]60178173[/TD]
[TD]7247[/TD]
[TD]38125ESS[/TD]
[TD="align: right"]14746640086[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60178173[/TD]
[TD]7247[/TD]
[TD]38125ESS[/TD]
[TD="align: right"]14746640086[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60178173[/TD]
[TD]7247[/TD]
[TD]38125ESS[/TD]
[TD="align: right"]14746640086[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60178173[/TD]
[TD]7247[/TD]
[TD]05846AQU[/TD]
[TD="align: right"]14746558466[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60178173[/TD]
[TD]7247[/TD]
[TD]05846AQU[/TD]
[TD="align: right"]14746558466[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60171864[/TD]
[TD]7247[/TD]
[TD]26342BIO[/TD]
[TD="align: right"]17541621557[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60171864[/TD]
[TD]7247[/TD]
[TD]26342BIO[/TD]
[TD="align: right"]17541621557[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON[/TD]
[/TR]
[TR]
[TD]60171864[/TD]
[TD]7247[/TD]
[TD]26342BIO[/TD]
[TD="align: right"]17541621557[/TD]
[TD="align: right"]1[/TD]
[TD]EA [/TD]
[TD]V796[/TD]
[TD]D796[/TD]
[TD]PCON
[/TD]
[/TR]
</tbody>[/TABLE]
After the macro is run the result should match the table below.
[TABLE="width: 422"]
<colgroup><col><col><col><col span="2"></colgroup><tbody>[TR]
[TD]Store[/TD]
[TD]Material[/TD]
[TD]Order qty[/TD]
[TD]UoM[/TD]
[TD]RA #[/TD]
[/TR]
[TR]
[TD]7247[/TD]
[TD]38125ESS[/TD]
[TD="align: right"]3[/TD]
[TD]EA[/TD]
[TD]60178173[/TD]
[/TR]
[TR]
[TD]7247[/TD]
[TD]05846AQU[/TD]
[TD="align: right"]2[/TD]
[TD]EA[/TD]
[TD]60178173[/TD]
[/TR]
[TR]
[TD]7247[/TD]
[TD]26342BIO[/TD]
[TD="align: right"]3[/TD]
[TD]EA[/TD]
[TD]60171864[/TD]
[/TR]
</tbody>[/TABLE]