Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Search And Replace Whole Words

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Search And Replace Whole Words

thank you

"Toppers" wrote:

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

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
Replace several words to One Wanna Learn Excel Discussion (Misc queries) 2 April 30th 08 01:56 PM
search of words bookworm Excel Discussion (Misc queries) 3 February 12th 07 07:42 PM
replace numbers in English words- Mani K Excel Worksheet Functions 2 February 12th 07 10:03 AM
How can i find and replace words mean from one file to another?? atarodi Excel Programming 0 October 28th 05 05:46 PM
Excel to replace words ? Andy100 New Users to Excel 13 August 28th 05 05:17 PM


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

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"