marcelo_abreu
New Member
- Joined
- Feb 23, 2018
- Messages
- 3
So I need your help! Firstly I am a student and don't really know much about VBA, because my teacher skipped those classes, whatever...
I have a table with a long number of rows and data in columns.I wanna transpose them to rows and deleting duplicates, so it's better to review the data.
I'm thinking about doing this with a macro of course.
The table I got is similar to the next one:
[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD]Unit Procudure[/TD]
[TD]Unit Operation[/TD]
[TD]Operation Parameter[/TD]
[TD]Parameter Value[/TD]
[TD]Eng. Units[/TD]
[TD]Origin[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]BEGIN_SD:1[/TD]
[TD]CIP_ST[/TD]
[TD]Rest[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]BEGIN_SD:1[/TD]
[TD]CND_ST[/TD]
[TD]Rest[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]BEGIN_SD:1[/TD]
[TD]DESC[/TD]
[TD]1[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]BEGIN_SD:1[/TD]
[TD]DRY_ST[/TD]
[TD]on[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:1[/TD]
[TD]CIP_ST[/TD]
[TD]Active[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:1[/TD]
[TD]CND_ST[/TD]
[TD]Rest[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:1[/TD]
[TD]DESC[/TD]
[TD]2[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:1[/TD]
[TD]DRY_ST[/TD]
[TD]off[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:2[/TD]
[TD]CIP_ST[/TD]
[TD]Rest[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:2[/TD]
[TD]CND_ST[/TD]
[TD]Active[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:2[/TD]
[TD]DESC[/TD]
[TD]3[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:2[/TD]
[TD]DRY_ST[/TD]
[TD]off[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]OPCHECK_SD:1[/TD]
[TD]DESC[/TD]
[TD]4[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]OPCHECK_SD:1[/TD]
[TD]B070_OUT_MAX[/TD]
[TD]100[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]OPCHECK_SD:1[/TD]
[TD]B070_OUT_MIN[/TD]
[TD]10[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]OPCHECK_SD:1[/TD]
[TD]Q4TYPE[/TD]
[TD]none[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]SETUP_SD:1[/TD]
[TD]B070_OUT_MAX[/TD]
[TD]50[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]SETUP_SD:1[/TD]
[TD]B070_OUT_MIN[/TD]
[TD]20[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]SETUP_SD:1[/TD]
[TD]DESC[/TD]
[TD]5[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
</tbody>[/TABLE]
So with a macro and a table like this (the actual table has over 300 rows and more operations and procedures):
-----
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD]Unit Procedure[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[/TR]
[TR]
[TD]Unit Operation[/TD]
[TD]BEGIN_SD:1[/TD]
[TD]DRYING_SD:1[/TD]
[TD]DRYING_SD:2[/TD]
[TD]OPCHECK_SD:1[/TD]
[TD]SETUP_SD:1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Operation Parameter[/TD]
[TD]Parameter Value[/TD]
[TD]Parameter Value[/TD]
[TD]Parameter Value[/TD]
[TD]Parameter Value[/TD]
[TD]Parameter Value[/TD]
[TD]Eng. Units[/TD]
[TD]Origin[/TD]
[/TR]
[TR]
[TD]CIP_ST[/TD]
[TD]Rest[/TD]
[TD]Active[/TD]
[TD]Rest[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]CND_ST[/TD]
[TD]Rest[/TD]
[TD]Rest[/TD]
[TD]Active[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]DESC[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]DRY_ST[/TD]
[TD]on[/TD]
[TD]off[/TD]
[TD]on[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]Q4TYPE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]none[/TD]
[TD][/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]B070_OUT_MAX[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]100[/TD]
[TD]50[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]B070_OUT_MIN[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]10[/TD]
[TD]20[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
</tbody>[/TABLE]
This would be the kind of result I'm tryna work on but can't figure it out.
Don't really know if it's possible.. If not I'd like some help on just the operation parameter and parameter value.
Excuse my english in any case of bad spelling, I'm portuguese.
Thank you, Marcelo!
I have a table with a long number of rows and data in columns.I wanna transpose them to rows and deleting duplicates, so it's better to review the data.
I'm thinking about doing this with a macro of course.
The table I got is similar to the next one:
[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD]Unit Procudure[/TD]
[TD]Unit Operation[/TD]
[TD]Operation Parameter[/TD]
[TD]Parameter Value[/TD]
[TD]Eng. Units[/TD]
[TD]Origin[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]BEGIN_SD:1[/TD]
[TD]CIP_ST[/TD]
[TD]Rest[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]BEGIN_SD:1[/TD]
[TD]CND_ST[/TD]
[TD]Rest[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]BEGIN_SD:1[/TD]
[TD]DESC[/TD]
[TD]1[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]BEGIN_SD:1[/TD]
[TD]DRY_ST[/TD]
[TD]on[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:1[/TD]
[TD]CIP_ST[/TD]
[TD]Active[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:1[/TD]
[TD]CND_ST[/TD]
[TD]Rest[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:1[/TD]
[TD]DESC[/TD]
[TD]2[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:1[/TD]
[TD]DRY_ST[/TD]
[TD]off[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:2[/TD]
[TD]CIP_ST[/TD]
[TD]Rest[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:2[/TD]
[TD]CND_ST[/TD]
[TD]Active[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:2[/TD]
[TD]DESC[/TD]
[TD]3[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]DRYING_SD:2[/TD]
[TD]DRY_ST[/TD]
[TD]off[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]OPCHECK_SD:1[/TD]
[TD]DESC[/TD]
[TD]4[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]OPCHECK_SD:1[/TD]
[TD]B070_OUT_MAX[/TD]
[TD]100[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]OPCHECK_SD:1[/TD]
[TD]B070_OUT_MIN[/TD]
[TD]10[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]OPCHECK_SD:1[/TD]
[TD]Q4TYPE[/TD]
[TD]none[/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]SETUP_SD:1[/TD]
[TD]B070_OUT_MAX[/TD]
[TD]50[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]SETUP_SD:1[/TD]
[TD]B070_OUT_MIN[/TD]
[TD]20[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]SETUP_SD:1[/TD]
[TD]DESC[/TD]
[TD]5[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
</tbody>[/TABLE]
So with a macro and a table like this (the actual table has over 300 rows and more operations and procedures):
-----
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD]Unit Procedure[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[TD]17CH43_SD1251_STARTUP[/TD]
[/TR]
[TR]
[TD]Unit Operation[/TD]
[TD]BEGIN_SD:1[/TD]
[TD]DRYING_SD:1[/TD]
[TD]DRYING_SD:2[/TD]
[TD]OPCHECK_SD:1[/TD]
[TD]SETUP_SD:1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Operation Parameter[/TD]
[TD]Parameter Value[/TD]
[TD]Parameter Value[/TD]
[TD]Parameter Value[/TD]
[TD]Parameter Value[/TD]
[TD]Parameter Value[/TD]
[TD]Eng. Units[/TD]
[TD]Origin[/TD]
[/TR]
[TR]
[TD]CIP_ST[/TD]
[TD]Rest[/TD]
[TD]Active[/TD]
[TD]Rest[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]CND_ST[/TD]
[TD]Rest[/TD]
[TD]Rest[/TD]
[TD]Active[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]DESC[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]min[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]DRY_ST[/TD]
[TD]on[/TD]
[TD]off[/TD]
[TD]on[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]Q4TYPE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]none[/TD]
[TD][/TD]
[TD][/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]B070_OUT_MAX[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]100[/TD]
[TD]50[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]B070_OUT_MIN[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]10[/TD]
[TD]20[/TD]
[TD]%[/TD]
[TD]Value[/TD]
[/TR]
</tbody>[/TABLE]
This would be the kind of result I'm tryna work on but can't figure it out.
Don't really know if it's possible.. If not I'd like some help on just the operation parameter and parameter value.
Excuse my english in any case of bad spelling, I'm portuguese.
Thank you, Marcelo!