KForrest42
New Member
- Joined
- Sep 8, 2016
- Messages
- 3
I currently have a three columns of data which I need to convert to a different layout using VBA.
I need to go from this:
[TABLE="width: 214"]
<tbody>[TR]
[TD]Tag
[/TD]
[TD]Drawing
[/TD]
[TD]Drawing Type
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]I1
[/TD]
[TD]IFC
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]I2
[/TD]
[TD]IFC
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]R1
[/TD]
[TD]Redline
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]B1
[/TD]
[TD]Bootleg
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]I3
[/TD]
[TD]IFC
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]R2
[/TD]
[TD]Redline
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]B2
[/TD]
[TD]Bootleg
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]I4
[/TD]
[TD]IFC
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]R3
[/TD]
[TD]Redline
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]I5
[/TD]
[TD]IFC
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]B3
[/TD]
[TD]Bootleg
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]D1
[/TD]
[TD]Detail
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]I6
[/TD]
[TD]IFC
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]I7
[/TD]
[TD]IFC
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]R4
[/TD]
[TD]Redline
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]R5
[/TD]
[TD]Redline
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]B4
[/TD]
[TD]Bootleg
[/TD]
[/TR]
</tbody>[/TABLE]
To this:
[TABLE="width: 502"]
<tbody>[TR]
[TD]Tag
[/TD]
[TD]IFC
[/TD]
[TD]IFC
[/TD]
[TD]Redline
[/TD]
[TD]Redline
[/TD]
[TD]Bootleg
[/TD]
[TD]Detail
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]I1
[/TD]
[TD]I2
[/TD]
[TD]R1
[/TD]
[TD][/TD]
[TD]B1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]I3
[/TD]
[TD][/TD]
[TD]R2
[/TD]
[TD][/TD]
[TD]B2
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]I4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD][/TD]
[TD][/TD]
[TD]R3
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]I5
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]B3
[/TD]
[TD]D1
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]I6
[/TD]
[TD]I7
[/TD]
[TD]R4
[/TD]
[TD]R5
[/TD]
[TD]B4
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The duplicates are removed from the "Tag" column, but if there are duplicates in the "Drawing Type" column for that tag, new columns need to be added to accommodate the different drawing numbers. Any help would be appreciated. Thanks
I need to go from this:
[TABLE="width: 214"]
<tbody>[TR]
[TD]Tag
[/TD]
[TD]Drawing
[/TD]
[TD]Drawing Type
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]I1
[/TD]
[TD]IFC
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]I2
[/TD]
[TD]IFC
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]R1
[/TD]
[TD]Redline
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]B1
[/TD]
[TD]Bootleg
[/TD]
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/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD][/TD]
[TD][/TD]
[TD]R3
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]I5
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]B3
[/TD]
[TD]D1
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]I6
[/TD]
[TD]I7
[/TD]
[TD]R4
[/TD]
[TD]R5
[/TD]
[TD]B4
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
The duplicates are removed from the "Tag" column, but if there are duplicates in the "Drawing Type" column for that tag, new columns need to be added to accommodate the different drawing numbers. Any help would be appreciated. Thanks