Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Substitute a comma with a line break in a cell

Tags:

excel

In the cell below, I want to get whatever is separated by a comma to come to a new line. I can add these line breaks manually with alt+enter, but this time I want to automate it.

BCM:Open,Event:Site XXXX is down,Service Affected :2G,Impact :Coverage Restored at XXXX Area,Reason:Under Investigation,Recovery Time :30 Minutes,Start time:14:25:13,End Time:15:18:03,Duration:00:52:50,SLA:1 Hour.

like image 623
user2068763 Avatar asked Feb 13 '13 15:02

user2068763


People also ask

How do you replace a comma with a line break in Excel?

In the Replace with field, press Ctrl + J to insert a carriage return. This will insert a line break in place of each comma; the commas will be removed. If you'd like to keep a comma at the end of each line but last, type a comma and then press the Ctrl + J shortcut. Click the Replace All button.

How do you replace commas with line breaks?

Select the cells containing the commas you need to replace with newlines, then press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window. 3. Press the F5 key or click the Run button to run the code. Then all commas in selected cells are replaced with newlines immediately.

Can you do a line break within a cell in Excel?

To start a new line of text or add spacing between lines or paragraphs of text in a worksheet cell, press Alt+Enter to insert a line break. Double-click the cell in which you want to insert a line break (or select the cell and then press F2). Click the location inside the selected cell where you want to break the line.


1 Answers

For some reason, none of the above worked for me. This DID however:

  1. Selected the range of cells I needed to replace.
  2. Go to Home > Find & Select > Replace or Ctrl + H
  3. Find what: ,
  4. Replace with: CTRL + SHIFT + J
  5. Click Replace All

Somehow CTRL + SHIFT + J is registered as a linebreak.

like image 192
ckpepper02 Avatar answered Oct 15 '22 01:10

ckpepper02