Hi,
Apologies if this type of solution has been posted elsewhere - I have been attempting to use a variation of the solution provided under https://www.mrexcel.com/forum/excel...-paste-row-while-replacing-2-cell-values.html
What I'm trying to achieve is having excel look through a column to locate ", " and split up the text within the cell located into a number of rows. As shown in the tables below; ID 3 would be copied over three times and ID 4 twice. I found difficulty with identifying the 'original' row with its cell contents (minus what had already been copied over).
New to the VBA scene, so I'm hoping someone could assist.
Current data
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Content[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]RD-001[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]RD-002[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]RD-003, RD-004, RD-005[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]RD-006, RD-007[/TD]
[/TR]
</tbody>[/TABLE]
Data I'd like to have after running the macro
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Content[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]RD-001[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]RD-002[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]RD-003[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]RD-004[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]RD-005[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]RD-006[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]RD-007[/TD]
[/TR]
</tbody>[/TABLE]
Edit; Title was meant to read 'VBA - Copy row, adjust cell content and remove redundant cell content'
Apologies if this type of solution has been posted elsewhere - I have been attempting to use a variation of the solution provided under https://www.mrexcel.com/forum/excel...-paste-row-while-replacing-2-cell-values.html
What I'm trying to achieve is having excel look through a column to locate ", " and split up the text within the cell located into a number of rows. As shown in the tables below; ID 3 would be copied over three times and ID 4 twice. I found difficulty with identifying the 'original' row with its cell contents (minus what had already been copied over).
New to the VBA scene, so I'm hoping someone could assist.
Current data
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Content[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]RD-001[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]RD-002[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]RD-003, RD-004, RD-005[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]RD-006, RD-007[/TD]
[/TR]
</tbody>[/TABLE]
Data I'd like to have after running the macro
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Content[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]RD-001[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]RD-002[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]RD-003[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]RD-004[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]RD-005[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]RD-006[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]RD-007[/TD]
[/TR]
</tbody>[/TABLE]
Edit; Title was meant to read 'VBA - Copy row, adjust cell content and remove redundant cell content'
Last edited: