Replace

  • Thread starter Thread starter Kilcup
  • Start date Start date
K

Kilcup

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top