#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Replace

Simple Question!

I am trying to replace a cell that contains text with another string
and though I know the answer is simple, I cannot seem to find what cod
process to use. The text is in cell A4 and it needs to be replace
prior to exporting it to a text document.

If anyone can tell me how to replace this in vba, I would appreciate i
a lot.

Jef

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Replace

Jeff

and the simple answer is: just record a macro as you carry out the task
manually. If you then edit the macro you just created you'll see the code
you need.

However, this will do what you want:

Sub OutWithTheOld()
Range("A4").Replace _
What:="old", _
Replacement:="new", _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub

Regards

Trevor


"Kilcup " wrote in message
...
Simple Question!

I am trying to replace a cell that contains text with another string,
and though I know the answer is simple, I cannot seem to find what code
process to use. The text is in cell A4 and it needs to be replaced
prior to exporting it to a text document.

If anyone can tell me how to replace this in vba, I would appreciate it
a lot.

Jeff


---
Message posted from http://www.ExcelForum.com/



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
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Can I replace a ' at the beginning of a text cell using Replace Hilde Excel Discussion (Misc queries) 4 September 10th 07 06:22 PM
Replace dialog should put focus on "Find What" not "Replace With" Michael Williams Excel Discussion (Misc queries) 0 May 24th 06 12:45 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
How can I use replace(alt+H) for mutiple items needing replace Gery Excel Worksheet Functions 1 June 15th 05 05:51 PM


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

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

About Us

"It's about Microsoft Excel"