InOverMyH3ad
New Member
- Joined
- Sep 17, 2018
- Messages
- 13
- Office Version
- 365
- Platform
- Windows
Hello All,
I've been trying to find a macro to group data from a report. The problem is that the hierarchy it spits out is different so I have been having trouble finding code to work for my scenario. Below is how the data comes in and what it represents. I'm really stuck :/
[TABLE="class: grid, width: 150"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:5632;width:119pt" width="158"> </colgroup><tbody>[TR]
[TD="width: 158"]How the Data Comes In
[/TD]
[/TR]
[TR]
[TD]0
[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:3100;width:65pt" width="87"> <col style="mso-width-source:userset;mso-width-alt:4664;width:98pt" width="131"> <col style="width:48pt" width="64"> <col style="width:48pt" width="64" span="2"> <col style="mso-width-source:userset;mso-width-alt:6400;width:135pt" width="180"> </colgroup><tbody>[TR]
[TD="width: 410, colspan: 5, align: center"]What it Represents
[/TD]
[TD="width: 180"][/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Total Price of A-F[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]A[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of A[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]B[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of B[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]C[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of C1-C5[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]C1
[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of C1.1-C1.2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]C1.1[/TD]
[TD] [/TD]
[TD="align: left"]Price of C1.1
[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]C1.2[/TD]
[TD] [/TD]
[TD="align: left"]Price of C2.2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]C2[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of C2.1-C2.3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]C2.1[/TD]
[TD] [/TD]
[TD="align: left"]Price of C2.1[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]C2.2[/TD]
[TD] [/TD]
[TD="align: left"]Price of C2.2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]C2.3[/TD]
[TD] [/TD]
[TD="align: left"]Price of C2.3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]C3[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of C3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]D[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of D[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]D1[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of D1.1-D1.3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]D1.1[/TD]
[TD] [/TD]
[TD="align: left"]Price of D1.1[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]D1.2[/TD]
[TD] [/TD]
[TD="align: left"]Price of D1.2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]D1.3[/TD]
[TD] [/TD]
[TD="align: left"]Price of D1.3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]D2[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of D2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]E[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of E[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]F[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of F[/TD]
[/TR]
</tbody>[/TABLE]
I've been trying to find a macro to group data from a report. The problem is that the hierarchy it spits out is different so I have been having trouble finding code to work for my scenario. Below is how the data comes in and what it represents. I'm really stuck :/
[TABLE="class: grid, width: 150"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:5632;width:119pt" width="158"> </colgroup><tbody>[TR]
[TD="width: 158"]How the Data Comes In
[/TD]
[/TR]
[TR]
[TD]0
[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]3[/TD]
[/TR]
[TR]
[TD]2[/TD]
[/TR]
[TR]
[TD]1[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<colgroup><col style="mso-width-source:userset;mso-width-alt:3100;width:65pt" width="87"> <col style="mso-width-source:userset;mso-width-alt:4664;width:98pt" width="131"> <col style="width:48pt" width="64"> <col style="width:48pt" width="64" span="2"> <col style="mso-width-source:userset;mso-width-alt:6400;width:135pt" width="180"> </colgroup><tbody>[TR]
[TD="width: 410, colspan: 5, align: center"]What it Represents
[/TD]
[TD="width: 180"][/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Total Price of A-F[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]A[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of A[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]B[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of B[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]C[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of C1-C5[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]C1
[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of C1.1-C1.2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]C1.1[/TD]
[TD] [/TD]
[TD="align: left"]Price of C1.1
[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]C1.2[/TD]
[TD] [/TD]
[TD="align: left"]Price of C2.2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]C2[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of C2.1-C2.3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]C2.1[/TD]
[TD] [/TD]
[TD="align: left"]Price of C2.1[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]C2.2[/TD]
[TD] [/TD]
[TD="align: left"]Price of C2.2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]C2.3[/TD]
[TD] [/TD]
[TD="align: left"]Price of C2.3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]C3[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of C3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]D[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of D[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]D1[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of D1.1-D1.3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]D1.1[/TD]
[TD] [/TD]
[TD="align: left"]Price of D1.1[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]D1.2[/TD]
[TD] [/TD]
[TD="align: left"]Price of D1.2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]D1.3[/TD]
[TD] [/TD]
[TD="align: left"]Price of D1.3[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD]D2[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of D2[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]E[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of E[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]F[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: left"]Price of F[/TD]
[/TR]
</tbody>[/TABLE]