Replacing Multiple Spaces with Line Breaks

ryanh6

New Member
Joined
Jul 7, 2016
Messages
21
I need a quick fix for an issue I've been having. Basically I have a data base, and I send versions to people to populate. However, in the excel sheet that I have sent, people have been inserting multiple spaces, in place of a line break. I need to remove these spaces and replace them with a line break, without removing the spaces that belong between words. I have tried many combinations of the substitute and trim function but have not found any solution. Thanks in advance!! See below for example:

[TABLE="width: 500"]
<tbody>[TR]
[TD]123-456-789.0
987-654-321.0 456-789-123.0
[/TD]
[TD]123-456-789.0 Document Number1 987-654-321.0 Document2 456-789-123.0 DocumentName 3
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Or replace the spaces with another character as the editor of the page deletes surplus pages so they are not visible.
 
Upvote 0
Or replace the spaces with another character as the editor of the page deletes surplus pages so they are not visible.

Each cell would be in this format, with 700 cells in this format, except spaces instead of "-"

Thanks!
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]123-456-789.0 Document Name 1-----------------------------------------987-654-321.0 Document Name2-----------------------------------------456-789-123.0 DocumentName 3
[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
Find and replace:

In the Find what, type space space

In Replace, Ctrl+J

Replace all until there are no replacements

Then replace Ctrl+J Ctrl+J with Ctrl+J until there are no replacements

Takes longer to describe than do.
 
Upvote 0

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

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