Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to split comma separated values into rows or columns in Excel?

In some cases, you may need to split comma separated values of selected cells into rows or columns. Here we will introduce three methods for you to solve this problem in details.

Split comma separated values into columns with Text to Columns function

Split comma separated values into rows with VBA code

Quickly split comma separated values into rows or columns with Kutools for Excel


Easily split comma separated values into rows or columns in Excel:

Kutools for Excel's Split Cells utility helps you easily split cell contents by space, comma, new line or other separators into separated rows or columns in Excel. Download the full feature 60-day free trail of Kutools for Excel now!

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download the free trial Now!


Split comma separated values into columns with Text to Columns function

You can apply the Text to Columns function to split comma separated values of selected cells into columns. Please do as follows.

1. Select the range of cells you want to split values into columns, and then click Data > Text to Columns. See screenshot:

2. In the first Convert Text to Columns Wizard dialog box, select the Delimited option, and then click the Next button.

3. In the second Convert Text to Columns Wizard dialog box, only check the Comma box in the Delimiters section, and click the Next button.

4. In the last Convert Text to Columns Wizard dialog box, select a cell for locating the splitting values in the Destination box, and finally click the Finish button. See screenshot:

Now all the values in selected cells which were separated by commas are split to different columns as bellow screenshot shown.


Split comma separated values into rows with VBA code

For splitting comma separated values into rows, you can apply the following VBA code.

1. Press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.

2. In the Microsoft Visual Basic for Applications window, click Insert > Module. Then copy and paste the below VBA code into the Module window.

VBA code: Split comma separated values into rows

Sub SplitAll()
	Dim xRg As Range
	Dim xRg1 As Range
	Dim xCell As Range
	Dim I As Long
	Dim xAddress As String
	Dim xUpdate As Boolean
	Dim xRet As Variant
	On Error Resume Next
	xAddress = Application.ActiveWindow.RangeSelection.Address
	Set xRg  = Application.InputBox("Please select a range", "Kutools for Excel", xAddress, , , , , 8)
	Set xRg  = Application.Intersect(xRg, xRg.Worksheet.UsedRange)
	If xRg Is Nothing Then Exit Sub
		If xRg.Columns.Count > 1 Then
			MsgBox "You can't select multiple columns", , "Kutools for Excel"
			Exit Sub
			End If
			Set xRg1 = Application.InputBox("Split to (single cell):", "Kutools for Excel", , , , , , 8)
			Set xRg1 = xRg1.Range("A1")
			If xRg1 Is Nothing Then Exit Sub
				xUpdate = Application.ScreenUpdating
				Application.ScreenUpdating = False
				For Each xCell In xRg
					xRet = Split(xCell.Value, ",")
					xRg1.Worksheet.Range(xRg1.Offset(I, 0), xRg1.Offset(I + UBound(xRet, 1), 0)) = Application.WorksheetFunction.Transpose(xRet)
					I = I + UBound(xRet, 1) + 1
				Next
				Application.ScreenUpdating = xUpdate
			End Sub

3. Press the F5 key to run the code. In the popping up Kutools for Excel dialog box, select the cells you want to split, and then click the OK button.

4. In the second popping up Kutools for Excel dialog box, select a cell for locating the splitting values, then click OK.

Then you can see the comma separated values in selected cells are split into rows as bellow screenshot shown.


Quickly split comma separated values into rows or columns with Kutools for Excel

The Split Cells utility of Kutools for Excel can help you split comma separated values into rows or columns easily.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days. 

1. Select the cells you need to split, and then click Kutools > Text > Split Cells. See screenshot:

2. In the Split Cells dialog box, select Split to Rows or Split to Columns in the Type section as you need. And in the Specify a separator section, select the Other option, enter the comma symbol into the textbox, and then click the OK button. See screenshot:

3 .And then another prompt box will pop out to remind you select a cell to output the result, see screenshot:

4. Click OK button, you can see the results as below screenshots shown.

Split to Columns

Split to Rows


Office Tab - Tabbed Browsing, Editing, and Managing of Workbooks in Excel:

Office Tab brings the tabbed interface as seen in web browsers such as Google Chrome, Internet Explorer new versions and Firefox to Microsoft Excel. It will be a time-saving tool and irreplaceble in your work. See below demo:

Click for free trial of Office Tab!

Office Tab for Excel

Demo: Quickly split comma separated values into rows or columns with Kutools for Excel


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

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!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • 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!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Tim · 15 days ago
    This is amazing, thanks for making it free and easy to use!
  • To post as a guest, your comment is unpublished.
    Seb · 11 months ago
    Thank you!
  • To post as a guest, your comment is unpublished.
    Jake · 1 years ago
    Alternately for separating into rows, use the text to column steps and then copy & paste ->transpose to turn the columns into rows.
    • To post as a guest, your comment is unpublished.
      cam · 2 months ago
      Thanks Jake! This is what I was looking for. :)
  • To post as a guest, your comment is unpublished.
    Pradeep · 2 years ago
    Good one, the utility help me a lot. Thanks for that... :)