ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   trying to replace 2 spaces with 1 (https://www.excelbanter.com/excel-worksheet-functions/143016-trying-replace-2-spaces-1-a.html)

mgm

trying to replace 2 spaces with 1
 
Is there a way to search and replace within a column where there are 2
spaces present? When I search for " " (no quotes) it says cannot be found.

Thanks!
mgm



T. Valko

trying to replace 2 spaces with 1
 
It works ok for me.

A1 = try<space<spacethis
A2 = lets try this
A3 = try it

Select A1:A3
Goto EditReplace
Find what: hit the space bar twice
Replace with: hit the space bar once
Replace all

Results:

A1 = try this
A2 = lets try this
A3 = try it

Biff

"mgm" wrote in message
...
Is there a way to search and replace within a column where there are 2
spaces present? When I search for " " (no quotes) it says cannot be
found.

Thanks!
mgm




andy62

trying to replace 2 spaces with 1
 
Maybe someone else can respond with the technical explanation ("ansi
characters . . .") of why this works, but here's my approach:

- In some unused cell, type two spaces
- Highlight what you just typed and press Ctrl-C to copy
- Open the Replace function and paste (Ctrl-V) into the "Find What" field
- Paste again into the "Replace With" field, then hit backspace to eliminate
one of the two spaces.

If you want to limit your Replace to just one column, highlight that column
before invoking the Replace function.

HTH

"mgm" wrote:

Is there a way to search and replace within a column where there are 2
spaces present? When I search for " " (no quotes) it says cannot be found.

Thanks!
mgm




Niek Otten

trying to replace 2 spaces with 1
 
You may have Non-Breaking Spaces in the cell. You can check with the Code() function
Look here for code to remove them:

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


"mgm" wrote in message ...
| Is there a way to search and replace within a column where there are 2
| spaces present? When I search for " " (no quotes) it says cannot be found.
|
| Thanks!
| mgm
|
|



Niek Otten

trying to replace 2 spaces with 1
 
BTW, the TRIM() function reduces multiple spaces to single ones (and removes leading and trailing spaces)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


"Niek Otten" wrote in message ...
| You may have Non-Breaking Spaces in the cell. You can check with the Code() function
| Look here for code to remove them:
|
| http://www.mvps.org/dmcritchie/excel/join.htm#trimall
|
| --
| Kind regards,
|
| Niek Otten
| Microsoft MVP - Excel
|
|
| "mgm" wrote in message ...
|| Is there a way to search and replace within a column where there are 2
|| spaces present? When I search for " " (no quotes) it says cannot be found.
||
|| Thanks!
|| mgm
||
||
|
|



Bob Umlas

trying to replace 2 spaces with 1
 
Another thing to look for -- make sure you don't have the checkbox "Match
Entire Cell Contents" selected! It could have been selected from a previous
Find/Replace.
Bob Umlas
Excel MVP

"mgm" wrote in message
...
Is there a way to search and replace within a column where there are 2
spaces present? When I search for " " (no quotes) it says cannot be
found.

Thanks!
mgm





All times are GMT +1. The time now is 01:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com