View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Find & Replace Whole Words

John,

Excel has the functionality built in, check out Edit|Replace.

If you want to do it with a macro then try this:-

Sub sonic()
findstring = InputBox("Enter what to find")
replacestring = InputBox("Enter what to replace it with")
Cells.Replace What:=findstring, Replacement:=replacestring
End Sub

Mike

"John Svendsen" wrote:

Hi All:
I need to find & replace Whole Words in Excel 2003 - Word has this option,
but not Excel.
I've been looking for code to do this in VBA but all I find are canned
programs/Add-ins.
Can someone please give me an idea of how to do this in VBA for Excel 2003?
TIA, JS