View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Search And Replace Whole Words

Hi,

Columns("I:I").Select
Selection.Replace What:="20", Replacement:="general damage", lookat:=xlWhole

HTH

"Mary H" wrote:

I am writing a program that searchs a column for code numbers and replaces it
with a descritpion of that corresponding code number. Here is an exerpt of
the code

Columns("I:I").Select
Selection.Replace What:="20", Replacement:="general damage"

The problem I am having is if there is a code 5420 or anything else that has
that number in it, it replaces the 20 part with the text specified. I would
like to know how to do a search and replace of a whole value.

Thanks in advance