Hi
How can easily replace 2 or more spaces between words with a single space?
Also, is there a way I can delete a table row if all columns are empty? Can I use a Find/Replace of some sort to do this or do I need to write some VBA that process all tables/rows checking for empty cell and deleting the row? :-(
Thanks.
Robie
replace several spaces with single space
-
- 5StarLounger
- Posts: 656
- Joined: 18 Feb 2010, 14:26
-
- GoldLounger
- Posts: 2599
- Joined: 24 Jan 2010, 15:26
- Location: Olympia, WA
Re: delete all spaces between words
Do you mean 2 or more spaces, other wise the words would run together?
If it 2 or more, just do a Replace of 2 spaces for 1. This may need to be run several times.
I would sort the table, and all of the blank rows would be grouped and the you could select and delete them.
But then you would need to resort to back to the way it was before the first sort.
If it 2 or more, just do a Replace of 2 spaces for 1. This may need to be run several times.
I would sort the table, and all of the blank rows would be grouped and the you could select and delete them.
But then you would need to resort to back to the way it was before the first sort.
I am so far behind, I think I am First
Genealogy....confusing the dead and annoying the living
Genealogy....confusing the dead and annoying the living
-
- 5StarLounger
- Posts: 656
- Joined: 18 Feb 2010, 14:26
Re: delete all spaces between words
Thanks for the response Dave.DaveA wrote:Do you mean 2 or more spaces, other wise the words would run together?
If it 2 or more, just do a Replace of 2 spaces for 1. This may need to be run several times.
I would sort the table, and all of the blank rows would be grouped and the you could select and delete them.
But then you would need to resort to back to the way it was before the first sort.
Basically, I would like to replace 2 or more spaces between words with a single space. Sorry, my original post was not clear.
-
- 5StarLounger
- Posts: 656
- Joined: 18 Feb 2010, 14:26
Re: replace several spaces with single space
Update to my OP:
I have managed to find an old macro which removes empty rows from the table. So, i will try to use that one.
Thanks.
I have managed to find an old macro which removes empty rows from the table. So, i will try to use that one.
Thanks.
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: replace several spaces with single space
Try this:Robie wrote:How can easily replace 2 or more spaces between words with a single space?
1. Press Ctrl+H to open the Find and Replace dialog box.
2. Click the More button to display the search options.
3. Select the Use wildcards check box (this method won’t work unless this option is turned on).
4. In the Find what field, press the spacebar once followed by {2,}. (Two spaces minimum followed by a comma indicating any amount maximum)
5. In the Replace with field, press the spacebar once.
6. Click Replace All.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 78471
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: replace several spaces with single space
Even easier (but it may not always do what you want):
- Press Ctrl+H to activate the Replace dialog.
- Enter ^w in the 'Find what' box. This stands for 'white space' - any combination of spaces and tab characters.
- Enter a single space in the 'Replace with' box.
- Click 'Replace All'.
- Press Ctrl+H to activate the Replace dialog.
- Enter ^w in the 'Find what' box. This stands for 'white space' - any combination of spaces and tab characters.
- Enter a single space in the 'Replace with' box.
- Click 'Replace All'.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 656
- Joined: 18 Feb 2010, 14:26
Re: replace several spaces with single space
Thanks Rudi. That works wondefully well.Rudi wrote:Try this:Robie wrote:How can easily replace 2 or more spaces between words with a single space?
1. Press Ctrl+H to open the Find and Replace dialog box.
2. Click the More button to display the search options.
3. Select the Use wildcards check box (this method won’t work unless this option is turned on).
4. In the Find what field, press the spacebar once followed by {2,}. (Two spaces minimum followed by a comma indicating any amount maximum)
5. In the Replace with field, press the spacebar once.
6. Click Replace All.
-
- 5StarLounger
- Posts: 656
- Joined: 18 Feb 2010, 14:26
Re: replace several spaces with single space
You are right Hans. This is even easier. Like it very much.HansV wrote:Even easier (but it may not always do what you want):
- Press Ctrl+H to activate the Replace dialog.
- Enter ^w in the 'Find what' box. This stands for 'white space' - any combination of spaces and tab characters.
- Enter a single space in the 'Replace with' box.
- Click 'Replace All'.