spandan_rath
New Member
- Joined
- Jul 19, 2018
- Messages
- 2
Hi everyone!
I am looking for a vba script that would help me restructure my dataset. Currently my dataset is structured in the format shown below in the table.
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Val1[/TD]
[TD]Val2[/TD]
[TD]Val3[/TD]
[TD]Val4[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]abc[/TD]
[TD]xyz[/TD]
[TD]def[/TD]
[TD]ghi[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]123[/TD]
[TD]234[/TD]
[TD]345[/TD]
[TD]456[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]111[/TD]
[TD]222 [/TD]
[TD]333[/TD]
[TD]444[/TD]
[/TR]
</tbody>[/TABLE]
the output after the script is executed should yield: [TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Value#[/TD]
[TD]Val[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Val1[/TD]
[TD]abc[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Val2[/TD]
[TD]xyz[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Val3[/TD]
[TD]def[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Val4[/TD]
[TD]ghi[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Val1[/TD]
[TD]123[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Val2[/TD]
[TD]234[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Val3[/TD]
[TD]345[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Val4[/TD]
[TD]456[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Val1[/TD]
[TD]111[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Val2[/TD]
[TD]222[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Val3[/TD]
[TD]333[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Val4[/TD]
[TD]444[/TD]
[/TR]
</tbody>[/TABLE]
Thanks!
I am looking for a vba script that would help me restructure my dataset. Currently my dataset is structured in the format shown below in the table.
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Val1[/TD]
[TD]Val2[/TD]
[TD]Val3[/TD]
[TD]Val4[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]abc[/TD]
[TD]xyz[/TD]
[TD]def[/TD]
[TD]ghi[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]123[/TD]
[TD]234[/TD]
[TD]345[/TD]
[TD]456[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]111[/TD]
[TD]222 [/TD]
[TD]333[/TD]
[TD]444[/TD]
[/TR]
</tbody>[/TABLE]
the output after the script is executed should yield: [TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Value#[/TD]
[TD]Val[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Val1[/TD]
[TD]abc[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Val2[/TD]
[TD]xyz[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Val3[/TD]
[TD]def[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Val4[/TD]
[TD]ghi[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Val1[/TD]
[TD]123[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Val2[/TD]
[TD]234[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Val3[/TD]
[TD]345[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Val4[/TD]
[TD]456[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Val1[/TD]
[TD]111[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Val2[/TD]
[TD]222[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Val3[/TD]
[TD]333[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Val4[/TD]
[TD]444[/TD]
[/TR]
</tbody>[/TABLE]
Thanks!