Changing characters in a cell

N

nicole0904

I want to check a cell to see if the text contains a space in it and if
it does I need to change that to an _. Can anyone help?
 
D

Dave Peterson

Using a formula:

=substitute(a1," ","_")

(why bother checking??)

Or just select the range to inspect and
edit|replace
what: (spacebar)
with: _
replace all
 
P

Pete_UK

Use the SUBSTITUTE( ) function, such as:

=SUBSTITUTE(A1," ","_")

if your data is in A1.

Hope this helps.

Pete
 
C

CLR

Highlight the cell(s) then do Edit > Replace > ReplaceWhat: ALT32 > Replace
with: _ > ReplaceAll

Note, when typing the 32 while holding down the ALT key, use the 3 and 2
keys on the KEYPAD, not those on the Keyboard....

Vaya con Dios,
Chuck, CABGx3
 
D

Dave Peterson

Why not just hit the spacebar in the What box?
Highlight the cell(s) then do Edit > Replace > ReplaceWhat: ALT32 > Replace
with: _ > ReplaceAll

Note, when typing the 32 while holding down the ALT key, use the 3 and 2
keys on the KEYPAD, not those on the Keyboard....

Vaya con Dios,
Chuck, CABGx3
 
C

CLR

="Because"&CHAR(32)&"my"&CHAR(32)&"spacebar"&CHAR(32)&"is"&CHAR(32)&"broken?…….<g>"


Vaya con Dios,
Chuck, CABGx3
 
Top