LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Find and Replace Macro

Does anyone know how to find a value within a text string and replace
the entire cell value with a single word

For Example:

Do While Activecell.Offset(0, -1).Value < ""
IF Activecell.value < "(IN)" then
Activecell.value = "IN"
ElseIF Activecell.value < "(OUT)" Then
Activecell.value = "OUT"
ElseIF Activecell.value < "INNER" Then
Activecell.value = "INNER DOOR"
Else
Activecell.value = ""
End IF
Loop

What I am trying to do is to find the text value of (IN) , (OUT), and
INNER within a text string in cell.

The above example does not work. I know if I write three loops using
the find and replace method it should work, but this is not very
proficient in an excel worksheet that has more that 2000 rows. I need
to find a way to write one loop for this

Thank you for all of your help in advance
 
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 in a Macro [email protected] Excel Programming 4 December 1st 07 04:27 AM
Find & Replace and Find & Insert macro help needed RS Excel Programming 2 January 29th 07 07:35 AM
Macro to Find and Replace R Storey Excel Discussion (Misc queries) 6 December 6th 06 07:04 PM
Using Find and Replace to replace " in a macro snail30152 Excel Programming 1 April 13th 06 11:58 PM
Find/replace macro VB Newbie Excel Programming 1 November 13th 04 01:48 AM


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

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

About Us

"It's about Microsoft Excel"