Skip to main content

How to replace alt-enter with space/comma in Excel?

For example, there are some cells with carriage returns as below screenshot shown. Now you want to replace these alt-enter characters with space or comma in Excel, how could you deal with it? Actually, both Find and Replace feature and VBA can help you solve the problem.


Replace alt-enter with space/comma by Find and Replace feature

You can easily replace all-enter characters with space or comma by the Find and Replace feature in Excel. Please do as follows:
1. Select the cells you will replace the alt-enter characters, and press Ctrl + H keys to open the Find and Replace dialog box.

2. In the Find and Replace dialog box, under the Replace tab, please:
(1) In the Find What box press Ctrl + J keys to enter alt-enter character;
(2) In the Replace with box type space or comma as you need;
(3) Click the Replace All button. See screenshot:

3. Click the OK button in the popping out Microsoft Excel dialog box. And then close the Find and Replace dialog box.

Now you will see all alt-enter characters are replaced with your specified character, such as a comma. See screenshot:

Combine rows/columns into to one cell and separate with space, comma, new line, etc.

Kutools for Excel’s Combine Columns or Rows utility can help Excel users easily combine multiple columns or rows into one columns/row without losing data. In addition, Excel users can wrap these combined text strings with carriage or hard return, comma, space, semicolon, etc.


ad combine rows columns newline

Replace alt-enter with space/comma by VBA

If you are familiar with VBA, you can also replace the alt-enter characters with space, comma, or any other character as you need with VBA in Excel.

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

2. Click Insert > Module, and then paste below VBA code into the new module window.

VBA: Replace alt-enter with space/comma in Excel

Sub ReplaceLineBreak()
Dim xRg As Range
On Error Resume Next
Set xRg = Application.InputBox("Select Cells:", "KuTools for Excel", Selection.Address, , , , , 8)
If xRg Is Nothing Then Exit Sub
xRg.WrapText = False
xRg.Replace Chr(10), "Your text here", xlPart, xlByColumns
End Sub

Note: Before running the VBA, please find the code xRg.Replace Chr(10), "Your text here", xlPart, xlByColumns, and replace Your text here with space, comma, or other character as you need.

3. Press F5 key or click the Run button to run this VBA.

4. In the popping out KuTools for Excel dialog box, please select the cells you will replace the alt-enter characters, and click the OK button. See screenshot:

Now you will see all alt-enter characters are replaced with you specified character, such as comma. See screenshot:


Related articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations