modiria50989
New Member
- Joined
- Aug 11, 2017
- Messages
- 32
Hello,
Is there any Excel tool or VBA code to the following efficiently, thank you in advance:
I have a data sheet including a column of color names and a few columns of color codes in front of that. some colors have only 1 code, some 2, and some 3 codes. I need an efficient way that creates new row under a color that has 2 codes, and creates 2 new rows under a color that has 3 codes with the same color name. Unfortunately I don't see an option in this forum to attach my excel sheet. Anyway, for example, the date sheet (4-column) bellow is given and I need to get the second one (2-columns).
Just in case, in average, I'm dealing with a data sheet of "2000 Rows - 50 Columns".
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][TABLE="width: 130"]
<tbody>[TR]
[TD="class: xl65, width: 130"]color name[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD="class: xl65, width: 61"]code1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 43"]
<tbody>[TR]
[TD="class: xl65, width: 43"]code2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 43"]
<tbody>[TR]
[TD="class: xl65, width: 43"]code3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 130"]
<tbody>[TR]
[TD]Absolute Zero[/TD]
[/TR]
[TR]
[TD]Acajou[/TD]
[/TR]
[TR]
[TD]Acid green[/TD]
[/TR]
[TR]
[TD]Aero[/TD]
[/TR]
[TR]
[TD]Aero blue[/TD]
[/TR]
[TR]
[TD]African violet[/TD]
[/TR]
[TR]
[TD]Air Force blue (RAF)[/TD]
[/TR]
[TR]
[TD]Air Force blue (USAF)[/TD]
[/TR]
[TR]
[TD]Air superiority blue[/TD]
[/TR]
[TR]
[TD]Alabama crimson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]#0048BA[/TD]
[/TR]
[TR]
[TD]#4C2F27[/TD]
[/TR]
[TR]
[TD]68768[/TD]
[/TR]
[TR]
[TD]#7CB9E8[/TD]
[/TR]
[TR]
[TD]#C9FFE5[/TD]
[/TR]
[TR]
[TD]12863[/TD]
[/TR]
[TR]
[TD]#5D8AA8[/TD]
[/TR]
[TR]
[TD]#00308F[/TD]
[/TR]
[TR]
[TD]#72A0C1[/TD]
[/TR]
[TR]
[TD]#AF002A[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 43"]
<tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD]fax[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]79%[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]70%[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]bucks[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]69%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 50"]
<tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD]18%[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]man[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]434436[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][TABLE="width: 130"]
<tbody>[TR]
[TD="class: xl65, width: 130"]color name[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD="class: xl65, width: 61"]code[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 130"]
<tbody>[TR]
[TD]Absolute Zero[/TD]
[/TR]
[TR]
[TD]Acajou[/TD]
[/TR]
[TR]
[TD]Acajou[/TD]
[/TR]
[TR]
[TD]Acajou[/TD]
[/TR]
[TR]
[TD]Acid green[/TD]
[/TR]
[TR]
[TD]Aero[/TD]
[/TR]
[TR]
[TD]Aero[/TD]
[/TR]
[TR]
[TD]Aero blue[/TD]
[/TR]
[TR]
[TD]African violet[/TD]
[/TR]
[TR]
[TD]African violet[/TD]
[/TR]
[TR]
[TD]African violet[/TD]
[/TR]
[TR]
[TD]Air Force blue (RAF)[/TD]
[/TR]
[TR]
[TD]Air Force blue (USAF)[/TD]
[/TR]
[TR]
[TD]Air Force blue (USAF)[/TD]
[/TR]
[TR]
[TD]Air superiority blue[/TD]
[/TR]
[TR]
[TD]Alabama crimson[/TD]
[/TR]
[TR]
[TD]Alabama crimson[/TD]
[/TR]
[TR]
[TD]Alabama crimson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]#0048BA[/TD]
[/TR]
[TR]
[TD]#4C2F27[/TD]
[/TR]
[TR]
[TD]fax[/TD]
[/TR]
[TR]
[TD]18%[/TD]
[/TR]
[TR]
[TD]68768[/TD]
[/TR]
[TR]
[TD]#7CB9E8[/TD]
[/TR]
[TR]
[TD]79%[/TD]
[/TR]
[TR]
[TD]#C9FFE5[/TD]
[/TR]
[TR]
[TD]12863[/TD]
[/TR]
[TR]
[TD]70%[/TD]
[/TR]
[TR]
[TD]man[/TD]
[/TR]
[TR]
[TD]#5D8AA8[/TD]
[/TR]
[TR]
[TD]#00308F[/TD]
[/TR]
[TR]
[TD]bucks[/TD]
[/TR]
[TR]
[TD]#72A0C1[/TD]
[/TR]
[TR]
[TD]#AF002A[/TD]
[/TR]
[TR]
[TD]69%[/TD]
[/TR]
[TR]
[TD]434436[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Is there any Excel tool or VBA code to the following efficiently, thank you in advance:
I have a data sheet including a column of color names and a few columns of color codes in front of that. some colors have only 1 code, some 2, and some 3 codes. I need an efficient way that creates new row under a color that has 2 codes, and creates 2 new rows under a color that has 3 codes with the same color name. Unfortunately I don't see an option in this forum to attach my excel sheet. Anyway, for example, the date sheet (4-column) bellow is given and I need to get the second one (2-columns).
Just in case, in average, I'm dealing with a data sheet of "2000 Rows - 50 Columns".
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][TABLE="width: 130"]
<tbody>[TR]
[TD="class: xl65, width: 130"]color name[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD="class: xl65, width: 61"]code1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 43"]
<tbody>[TR]
[TD="class: xl65, width: 43"]code2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 43"]
<tbody>[TR]
[TD="class: xl65, width: 43"]code3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 130"]
<tbody>[TR]
[TD]Absolute Zero[/TD]
[/TR]
[TR]
[TD]Acajou[/TD]
[/TR]
[TR]
[TD]Acid green[/TD]
[/TR]
[TR]
[TD]Aero[/TD]
[/TR]
[TR]
[TD]Aero blue[/TD]
[/TR]
[TR]
[TD]African violet[/TD]
[/TR]
[TR]
[TD]Air Force blue (RAF)[/TD]
[/TR]
[TR]
[TD]Air Force blue (USAF)[/TD]
[/TR]
[TR]
[TD]Air superiority blue[/TD]
[/TR]
[TR]
[TD]Alabama crimson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]#0048BA[/TD]
[/TR]
[TR]
[TD]#4C2F27[/TD]
[/TR]
[TR]
[TD]68768[/TD]
[/TR]
[TR]
[TD]#7CB9E8[/TD]
[/TR]
[TR]
[TD]#C9FFE5[/TD]
[/TR]
[TR]
[TD]12863[/TD]
[/TR]
[TR]
[TD]#5D8AA8[/TD]
[/TR]
[TR]
[TD]#00308F[/TD]
[/TR]
[TR]
[TD]#72A0C1[/TD]
[/TR]
[TR]
[TD]#AF002A[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 43"]
<tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD]fax[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]79%[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]70%[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]bucks[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]69%[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 50"]
<tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD]18%[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]man[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]434436[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][TABLE="width: 130"]
<tbody>[TR]
[TD="class: xl65, width: 130"]color name[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD="class: xl65, width: 61"]code[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 130"]
<tbody>[TR]
[TD]Absolute Zero[/TD]
[/TR]
[TR]
[TD]Acajou[/TD]
[/TR]
[TR]
[TD]Acajou[/TD]
[/TR]
[TR]
[TD]Acajou[/TD]
[/TR]
[TR]
[TD]Acid green[/TD]
[/TR]
[TR]
[TD]Aero[/TD]
[/TR]
[TR]
[TD]Aero[/TD]
[/TR]
[TR]
[TD]Aero blue[/TD]
[/TR]
[TR]
[TD]African violet[/TD]
[/TR]
[TR]
[TD]African violet[/TD]
[/TR]
[TR]
[TD]African violet[/TD]
[/TR]
[TR]
[TD]Air Force blue (RAF)[/TD]
[/TR]
[TR]
[TD]Air Force blue (USAF)[/TD]
[/TR]
[TR]
[TD]Air Force blue (USAF)[/TD]
[/TR]
[TR]
[TD]Air superiority blue[/TD]
[/TR]
[TR]
[TD]Alabama crimson[/TD]
[/TR]
[TR]
[TD]Alabama crimson[/TD]
[/TR]
[TR]
[TD]Alabama crimson[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 61"]
<tbody>[TR]
[TD]#0048BA[/TD]
[/TR]
[TR]
[TD]#4C2F27[/TD]
[/TR]
[TR]
[TD]fax[/TD]
[/TR]
[TR]
[TD]18%[/TD]
[/TR]
[TR]
[TD]68768[/TD]
[/TR]
[TR]
[TD]#7CB9E8[/TD]
[/TR]
[TR]
[TD]79%[/TD]
[/TR]
[TR]
[TD]#C9FFE5[/TD]
[/TR]
[TR]
[TD]12863[/TD]
[/TR]
[TR]
[TD]70%[/TD]
[/TR]
[TR]
[TD]man[/TD]
[/TR]
[TR]
[TD]#5D8AA8[/TD]
[/TR]
[TR]
[TD]#00308F[/TD]
[/TR]
[TR]
[TD]bucks[/TD]
[/TR]
[TR]
[TD]#72A0C1[/TD]
[/TR]
[TR]
[TD]#AF002A[/TD]
[/TR]
[TR]
[TD]69%[/TD]
[/TR]
[TR]
[TD]434436[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Last edited: