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: 58
Default Macro to find and replace text in a worksheet

The following code snippet will replace TextToReplace with
ReplacementText in an Excel worksheet:

Cells.Replace What:=TextToReplace, Replacement:=ReplacementText,
LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
ReplaceFormat:=False

That's easy enough. I'm a little stumped by this next one though...

I want to replace the text in the cell TO THE LEFT of the cell
containing the string TextToReplace with something else, which I'll
call TextDescription.

How do I replace text in the cell NEXT to a cell containing a
particular string?

Travis

 
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
query with formula/macro to find text in worksheet and delete it James Excel Worksheet Functions 3 February 8th 08 06:59 AM
Find text - worksheet function or macro? sebh007 Excel Discussion (Misc queries) 6 January 8th 07 12:53 AM
Excel: Find/Replace for Data Validation text or Worksheet Objects [email protected] Excel Discussion (Misc queries) 3 May 22nd 06 07:16 PM
Using Find and Replace to replace " in a macro snail30152 Excel Programming 1 April 13th 06 11:58 PM
Creating a macro to find and replace text Louise Excel Worksheet Functions 10 June 8th 05 10:29 AM


All times are GMT +1. The time now is 05:02 AM.

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"