Space after period.

topi1

Board Regular
Joined
Aug 6, 2014
Messages
163
Office Version
  1. 2010
Trying to find a vba which will add a space between sentences if none exists. To clean up texts, email etc. for a column or entire sheet.Tried to learn about patterns but could not figure out how to do that on my own. Dr. Google didn't help either. Thank you.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Howdy,
Would you not just run 2 find and replace macros? One which searches for a period "." and replaces it with a period followed by a space ". " Then your second find and replace would look for 2 consecutive spaces " " and replace with one " "?
 
Upvote 0
Solution
Howdy,
Would you not just run 2 find and replace macros? One which searches for a period "." and replaces it with a period followed by a space ". " Then your second find and replace would look for 2 consecutive spaces " " and replace with one " "?
Isn't it just replace "<non-space character><full stop><non-space character>" with "<full stop><space>"
 
Upvote 0
Isn't it just replace "<non-space character><full stop><non-space character>" with "<full stop><space>"
Or that. I'm not sure how do to it via VBA. With my current knowledge, I'd just get 2 macros and get the VBA to run them when needed.
 
Upvote 0
Howdy,
Would you not just run 2 find and replace macros? One which searches for a period "." and replaces it with a period followed by a space ". " Then your second find and replace would look for 2 consecutive spaces " " and replace with one " "?
But of course. Simple but brilliant! Can't believe I didn't think of it. That is what happens when you think help is round the corner. You get lazy! Thank you much. I also added the same thing for ! and ?.
 
Upvote 0

Forum statistics

Threads
1,215,972
Messages
6,128,015
Members
449,414
Latest member
sameri

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