Magoosball
Board Regular
- Joined
- Jun 4, 2017
- Messages
- 70
- Office Version
- 365
I am trying to add onto a current VBA script to do the following:
The name itself and the number of names will be different each time the script is ran.
Before
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Animal[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Elephant[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Dragon[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Dog[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Cat[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Mourse[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Bird[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Hawk[/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD]Lion[/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD]Tiger[/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD]Bear[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Panda[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Snake[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Cobra[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Lion[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Dragon[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Mouse[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Bear[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Hawk[/TD]
[/TR]
</tbody>[/TABLE]
After: Column 2 should only have 4 merged cells going down in this example. Each 1 with Mike should be merged, each with April should be merged, Each with James merged and each with Thor merged. Wasn't sure how to add that in this table.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Animal[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Elephant, Dragon, Dog, Cat, Mouse, Bird, Hawk[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD]Lion, Tiger, Bear[/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Panda, Snake[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Cobra, Lion Dragon, Mouse, Bear, Hawk[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thank you in advance!!
The name itself and the number of names will be different each time the script is ran.
Before
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Animal[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Elephant[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Dragon[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Dog[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Cat[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Mourse[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Bird[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Hawk[/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD]Lion[/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD]Tiger[/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD]Bear[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Panda[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Snake[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Cobra[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Lion[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Dragon[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Mouse[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Bear[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Hawk[/TD]
[/TR]
</tbody>[/TABLE]
After: Column 2 should only have 4 merged cells going down in this example. Each 1 with Mike should be merged, each with April should be merged, Each with James merged and each with Thor merged. Wasn't sure how to add that in this table.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Animal[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Elephant, Dragon, Dog, Cat, Mouse, Bird, Hawk[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD]Lion, Tiger, Bear[/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]April[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Panda, Snake[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD]Cobra, Lion Dragon, Mouse, Bear, Hawk[/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Thor[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thank you in advance!!