Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
MosesX8
 
Posts: n/a
Default How do I replace a character with another?

In my spreadsheet I have the cells in column F referencing from cells in
column C. The original content in the cells in column C have spaces in them.
What I want to happen is have the cells in column E have all spaces ( )
replaced by periods (.). I know I can go to EditReplace, but the cells are
often updated and would be much easier if I didn't have to replace them every
time.

In cell C3:
A Stupid Example

In cell F3:
A.Stupid.Example

Thanks!
  #2   Report Post  
George Nicholson
 
Posts: n/a
Default

=SUBSTITUTE(C3," ",".")

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"MosesX8" wrote in message
...
In my spreadsheet I have the cells in column F referencing from cells in
column C. The original content in the cells in column C have spaces in
them.
What I want to happen is have the cells in column E have all spaces ( )
replaced by periods (.). I know I can go to EditReplace, but the cells
are
often updated and would be much easier if I didn't have to replace them
every
time.

In cell C3:
A Stupid Example

In cell F3:
A.Stupid.Example

Thanks!



  #3   Report Post  
MosesX8
 
Posts: n/a
Default

Thanks! Worked perfect. What if I wanted to substitute multiple characters?
In this case I want a space ( ), a colon (:), forward (/) and back slash (\),
and a few more. It's basically any character that won't go into a filename,
with an exception for the space. Thanks again!

And Bill, I tried out that code, and it works great, but the simple
substitute worked fine in my case.

"George Nicholson" wrote:

=SUBSTITUTE(C3," ",".")

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"MosesX8" wrote in message
...
In my spreadsheet I have the cells in column F referencing from cells in
column C. The original content in the cells in column C have spaces in
them.
What I want to happen is have the cells in column E have all spaces ( )
replaced by periods (.). I know I can go to EditReplace, but the cells
are
often updated and would be much easier if I didn't have to replace them
every
time.

In cell C3:
A Stupid Example

In cell F3:
A.Stupid.Example

Thanks!




  #4   Report Post  
Bill Kuunders
 
Posts: n/a
Default

Thanks for the feed back.
and George's solution is great.
For more than one character you may have to use the macro again.
Just copy the code several times and change the item you want to replace.
etc

--
Greetings from New Zealand
Bill K

"MosesX8" wrote in message
...
Thanks! Worked perfect. What if I wanted to substitute multiple
characters?
In this case I want a space ( ), a colon (:), forward (/) and back slash
(\),
and a few more. It's basically any character that won't go into a
filename,
with an exception for the space. Thanks again!

And Bill, I tried out that code, and it works great, but the simple
substitute worked fine in my case.

"George Nicholson" wrote:

=SUBSTITUTE(C3," ",".")

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"MosesX8" wrote in message
...
In my spreadsheet I have the cells in column F referencing from cells
in
column C. The original content in the cells in column C have spaces in
them.
What I want to happen is have the cells in column E have all spaces ( )
replaced by periods (.). I know I can go to EditReplace, but the cells
are
often updated and would be much easier if I didn't have to replace them
every
time.

In cell C3:
A Stupid Example

In cell F3:
A.Stupid.Example

Thanks!






  #5   Report Post  
MosesX8
 
Posts: n/a
Default

Alright, well...before when I tried out that code I was doing it in regular
cells with no formulas. This time I was putting it in the right way on the
cells with formulas, and it doesn't work. Any way to work around this?
--
-----
MosesX8
I've got questions, you've got answers!


"Bill Kuunders" wrote:

Thanks for the feed back.
and George's solution is great.
For more than one character you may have to use the macro again.
Just copy the code several times and change the item you want to replace.
etc

--
Greetings from New Zealand
Bill K

"MosesX8" wrote in message
...
Thanks! Worked perfect. What if I wanted to substitute multiple
characters?
In this case I want a space ( ), a colon (:), forward (/) and back slash
(\),
and a few more. It's basically any character that won't go into a
filename,
with an exception for the space. Thanks again!

And Bill, I tried out that code, and it works great, but the simple
substitute worked fine in my case.

"George Nicholson" wrote:

=SUBSTITUTE(C3," ",".")

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"MosesX8" wrote in message
...
In my spreadsheet I have the cells in column F referencing from cells
in
column C. The original content in the cells in column C have spaces in
them.
What I want to happen is have the cells in column E have all spaces ( )
replaced by periods (.). I know I can go to EditReplace, but the cells
are
often updated and would be much easier if I didn't have to replace them
every
time.

In cell C3:
A Stupid Example

In cell F3:
A.Stupid.Example

Thanks!








  #6   Report Post  
Bill Kuunders
 
Posts: n/a
Default


Moses
Not sure what you mean by doing it in cells with formula's.
The code does not make any distinction between normal or cells with
formula's.
Both will be changed.
The code needs to be entered in the vba editor into a module or into "this
workbook"

Any problems you can mail me a small example sheet and I can check the code.
It could be that there are added characters at the end of lines etc.

Greetings from New Zealand
Bill K
"MosesX8" wrote in message
...
Alright, well...before when I tried out that code I was doing it in
regular
cells with no formulas. This time I was putting it in the right way on the
cells with formulas, and it doesn't work. Any way to work around this?
--
-----
MosesX8
I've got questions, you've got answers!


"Bill Kuunders" wrote:

Thanks for the feed back.
and George's solution is great.
For more than one character you may have to use the macro again.
Just copy the code several times and change the item you want to replace.
etc

--
Greetings from New Zealand
Bill K

"MosesX8" wrote in message
...
Thanks! Worked perfect. What if I wanted to substitute multiple
characters?
In this case I want a space ( ), a colon (:), forward (/) and back
slash
(\),
and a few more. It's basically any character that won't go into a
filename,
with an exception for the space. Thanks again!

And Bill, I tried out that code, and it works great, but the simple
substitute worked fine in my case.

"George Nicholson" wrote:

=SUBSTITUTE(C3," ",".")

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"MosesX8" wrote in message
...
In my spreadsheet I have the cells in column F referencing from
cells
in
column C. The original content in the cells in column C have spaces
in
them.
What I want to happen is have the cells in column E have all spaces
( )
replaced by periods (.). I know I can go to EditReplace, but the
cells
are
often updated and would be much easier if I didn't have to replace
them
every
time.

In cell C3:
A Stupid Example

In cell F3:
A.Stupid.Example

Thanks!








  #7   Report Post  
Bill Kuunders
 
Posts: n/a
Default

There may be cleaner code than this..............
Used the macro recorder.

Range("A1:G12").Select
Selection.Replace What:=" ", Replacement:=".", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False

Add this into a vba module and give it a shrtcut or add it to the workbook
code
so that it can run each time before save or after whatever you
prefer..........
To get to the workbook code:
right click onto the excel picture on the left of the word "File" on the
excel menu.
select "view code"
select "workbook" in the dropdown list which shows (General)
select "before save" and paste the code between the sub()and end sub()
lines.

((Change the A1:G12 to suit.......))

Regards
--
Greetings from New Zealand
Bill K

"MosesX8" wrote in message
...
In my spreadsheet I have the cells in column F referencing from cells in
column C. The original content in the cells in column C have spaces in
them.
What I want to happen is have the cells in column E have all spaces ( )
replaced by periods (.). I know I can go to EditReplace, but the cells
are
often updated and would be much easier if I didn't have to replace them
every
time.

In cell C3:
A Stupid Example

In cell F3:
A.Stupid.Example

Thanks!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and replace Subu Excel Worksheet Functions 4 June 9th 05 07:01 PM
replace absolute references bj Excel Worksheet Functions 0 May 20th 05 07:18 PM
REPLACE outside of highlighted column Jane Excel Worksheet Functions 8 May 19th 05 01:54 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 09:56 PM
VB Find and Replace Bony_Pony Excel Worksheet Functions 10 December 6th 04 05:45 PM


All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"