Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default replace text string in cell automatically

How could I replace a text string in cell programatically?
Tks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default replace text string in cell automatically

Hi Stephen,

How could I replace a text string in cell programatically?


Try something like:

'=============
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range

Set WB = Workbooks("Book1") '<<==== CHANGE
Set SH = WB.Sheets("Sheet2") '<<==== CHANGE
Set Rng = SH.Range("A1:A10") '<<==== CHANGE

Rng.Replace What:="Bill", _
Replacement:="Ben", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub
'<<=============


---
Regards,
Norman


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 text string automatically in cell Stephen Excel Discussion (Misc queries) 3 July 1st 07 11:36 PM
Find and replace part of a text string [email protected] Excel Discussion (Misc queries) 2 July 10th 06 10:34 PM
Find a string between two delimeters and replace with text Jeff[_50_] Excel Programming 2 May 2nd 06 07:15 PM
Excel - Find & Replace text in a string bklim Excel Programming 5 June 14th 05 07:37 AM
Excel - Find & Replace text in a string bklim Excel Worksheet Functions 1 June 14th 05 06:42 AM


All times are GMT +1. The time now is 03:59 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"