VBA to Convert Comma Delimited Cell into Rows With values in Other Columns

desairs

New Member
Joined
Oct 17, 2013
Messages
2
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

ABCD
1Heading1Heading2Heading3Heading4
2123A,B,C
3456D,E,F,G

<tbody>
</tbody>

After


ABCD
1Heading1Heading2Heading3Heading4
2123A
3123B
4123C
5456D
6456E
7456F
8456G

<tbody>
</tbody>



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.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top