So I have used MrExcel a lot in the past, but I haven't ever had a question that has not been answered. Thank you for all of the help over the years.
I have found that recently, I have been getting a few spreadsheets where there are a multiple columns with one data item each and one column at the end with cells that contain comma or pipe delimited values. The number of delimited values is not consistent between rows.
I need VBA where I can define the number of columns to copy down and the column that contains the comma separated values and run it to convert the delimited cell to rows with the information from the other columns included. I have tried to figure it out but I am definitely stuck on this. I have included a sample of what I am
I.e.
Before
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Heading1[/TD]
[TD]Heading2[/TD]
[TD]Heading3[/TD]
[TD]Heading4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]A,B,C[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]D,E,F,G[/TD]
[/TR]
</tbody>[/TABLE]
After
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Heading1[/TD]
[TD]Heading2[/TD]
[TD]Heading3[/TD]
[TD]Heading4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]G[/TD]
[/TR]
</tbody>[/TABLE]
I appreciate any help I can get. It's possible that there is a topic on this but I was searching for the wrong thing.
I have found that recently, I have been getting a few spreadsheets where there are a multiple columns with one data item each and one column at the end with cells that contain comma or pipe delimited values. The number of delimited values is not consistent between rows.
I need VBA where I can define the number of columns to copy down and the column that contains the comma separated values and run it to convert the delimited cell to rows with the information from the other columns included. I have tried to figure it out but I am definitely stuck on this. I have included a sample of what I am
I.e.
Before
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Heading1[/TD]
[TD]Heading2[/TD]
[TD]Heading3[/TD]
[TD]Heading4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]A,B,C[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]D,E,F,G[/TD]
[/TR]
</tbody>[/TABLE]
After
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Heading1[/TD]
[TD]Heading2[/TD]
[TD]Heading3[/TD]
[TD]Heading4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[TD]G[/TD]
[/TR]
</tbody>[/TABLE]
I appreciate any help I can get. It's possible that there is a topic on this but I was searching for the wrong thing.