How to convert comma separated text string to list or rows in Excel?
Convert comma separated text string to rows with VBA code
The following VBA code may help you to convert multiple comma separated cell values to a column, please do as follows:
1. Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following macro in the Module Window.
VBA code: Convert comma separated text string to rows or list
'Updateby Extendoffice 2015924
Dim xArr() As String
Dim xAddress As String
Dim Rg As Range
Dim Rg1 As Range
On Error Resume Next
xAddress = Application.ActiveWindow.RangeSelection.Address
Set Rg = Application.InputBox("please select the data range:", "Kutools for Excel", xAddress, , , , , 8)
If Rg Is Nothing Then Exit Sub
Set Rg = Application.Intersect(Rg, Rg.Parent.UsedRange)
If Rg Is Nothing Then Exit Sub
Set Rg1 = Application.InputBox("please select output cell:", "Kutools for Excel", , , , , , 8)
If Rg1 Is Nothing Then Exit Sub
xArr = Split(Join(Application.Transpose(Rg.Value), ","), ",")
Rg1.Resize(UBound(xArr) + 1) = Application.Transpose(xArr)
Rg1.Resize(UBound(xArr) + 1).Select
3. Then press F5 key to run this code, in the popped out dialog box, select the data range that you want to convert, see screenshot:
4. And click OK, in the following dialog, specify a cell where you want to output the result, see screenshot:
5. Click OK button, the selected comma separated cell values have been converted into a list of rows. See screenshot:
Convert comma separated text string to rows with Kutools for Excel
If you have Kutools for Excel, with its Split Cells utility, you can quickly split the comma separated cell values into multiple rows or columns based on the comma delimiter as you need.
|Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.
After installing Kutools for Excel, please do with following steps:
1. Select the cell values that you want to convert to rows based on the comma separator.
2. Then click Kutools > Text > Split Cells, see screenshot:
3. In the Split Cells dialog box, select Split to Rows option under the Type section, and then from the Specify a separator section, check Other checkbox and then enter the comma into the text box, see screenshot:
4. Then click Ok, and another dialog will pop out to remind you select a cell to put the result, see screenshot:
5. And then click Ok button, the comma separated cells have been split into multiple rows based on the comma delimiter, see screenshot:
Click to know more about this Split Cells feature…
Download and free trial Kutools for Excel Now !
Demo: Convert comma separated text string to rows with Kutools for Excel
How to split cells into multiple columns or rows by carriage return?
How to split cell values into multiple columns in Excel?
Recommended Productivity Tools
Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings
300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for
1500+ work scenarios, helps you solve
82% Excel problems.
- Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
- Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
- Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
- Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
- No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
- Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
- 60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
- Change the way you work now, and give you a better life immediately!
- Increases your productivity by
50% when viewing and editing multiple documents.
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Open and create documents in new tabs of same window, rather than in new windows.
- Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!