

HOW TO REMOVE SPACES BETWEEN WORDS IN WORD CODE
In the module pane paste the code above.On the toolbar of the Visual Basic Editor, go to insert - module.Open the Visual Basic Editor by going to tools-Macro's-Visual Basic Editor or use Alt-F11 Here is the easy way to remove two or more than two spaces inbetween words, this method will work all the version of MS Word like 2003, 2007, 2010, 2013 and.'This time its looking for excessive spaces after a paragraph mark 'This line tells it to replace the excessive spaces with one space Place your cursor in the Find what text box and press the space bar twice to add two spaces. Ensure you are in the Replace tab in the Find and Replace dialog box. 'Here is where it is actually looking for spaces between words Delete Extra Spaces Using Word’s Find and Replace Tool 1. 'Checks the document for excessive spaces between words 'If something goes wrong, go to the errorhandler with the non-printing characters displayed, the ° indicates the non-breaking space. This routine will reduce those excessive spaces to one space. If you use a 'non-breaking space (CTRL+SHIFT+Spacebar), there will only be the space of a normal single space between the words where you use that key combination and the space between the otherwords will be increase to maintain the justification. You have imported text or pasted it into your document or for whatever reason, you have more than one space between a lot of the words. press ctrl h to get the 'find and replace. select one or several columns with the data to delete spaces between words. leading and trailing spaces will also be trimmed to 1, but will not be removed. this option needs fewer steps, but allows only deleting excess spaces between words. This will reduce the space size between the words. Using find & replace to remove extra spaces between words. SELECT * - FROM - ORDER BY RowNo, PartNo SELECT DISTINCT t2.Reduces excessive spaces between words to one space If there seems to be larger than normal spaces between the words when typing in Word 2010, go to: File> Options > Advanced > Display > Click on: Optimize character positioning for layout rather than readability.

Hit CTRL+A to select all the text in the document. SELECT RowNo, PartNo, RTRIM(LTRIM(MyWord)) AS MyWord If you get a Word document with double spaces, you can quickly strip out the extra spaces to meet modern standards by following these steps. WHERE CHARINDEX( ' ', LTRIM(Remainder))=0 UNION ALL SELECT RowNo, PartNo + 1 AS PartNo, LTRIM(Remainder) AS MyWord, NULL AS Remainder WHERE CHARINDEX( ' ', LTRIM(Remainder))>0 UNION ALL SELECT RowNo, PartNo + 1 AS PartNo, LEFT(LTRIM(Remainder), CHARINDEX( ' ', LTRIM(Remainder))-1) AS MyWord, RIGHT(LTRIM(Remainder), LEN(LTRIM(Remainder)) - CHARINDEX( ' ', LTRIM(Remainder))) AS Remainder SELECT ROW_NUMBER() OVER( ORDER BY MyText) AS RowNo, 1 AS PartNo, LEFT(LTRIM(MyText), CHARINDEX( ' ', LTRIM(MyText))-1) AS MyWord, RIGHT(LTRIM(MyText), LEN(LTRIM(MyText)) - CHARINDEX( ' ', LTRIM(MyText))) AS RemainderįROM WHERE CHARINDEX( ' ', LTRIM(MyText))>0 Hit Replace All and the unnecessary double spacing will be removed. Now press the tiny little down arrow at the end of the search box, choose Replace and type a single space in the Replace With box.

( ' This is another very strange text.'),ĭECLARE TABLE(RowNo INT, PartNo INT, MyWord VARCHAR( 255)) You can easily remove these by pressing Ctrl+F to open the find function and then typing a double space in the search box. with the non-printing characters displayed, the indicates the non-breaking space. Ensure you are in the Replace tab in the Find and Replace dialog box. If you use a 'non-breaking space (CTRL+SHIFT+Spacebar), there will only be the space of a normal single space between the words where you use that key combination and the space between the otherwords will be increase to maintain the justification. Copy Code DECLARE TABLE(MyText VARCHAR( 500)) Delete Extra Spaces Using Word’s Find and Replace Tool.
