Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Find a string between two delimeters and replace with text

I have a range of cells in which I must replace a string between ":" and ")"
with a new a new string.

Thanks in advance for your ideas.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Find a string between two delimeters and replace with text

Try some code like the following

Dim S As String
Dim Pos1 As Long
Dim Pos2 As Long
S = "123:asdf)abs"
Pos1 = InStr(S, ":")
Pos2 = InStr(S, ")")
S = Left(S, Pos1 - 1) & "new text" & Mid(S, Pos2 + 1)
Debug.Print S


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Jeff" wrote in message
...
I have a range of cells in which I must replace a string between
":" and ")"
with a new a new string.

Thanks in advance for your ideas.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Find a string between two delimeters and replace with text

Thanks,Chip. How do I get 'S' to refer to the active cell in which I want
to replace the tect?


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
Macro to copy text between two different delimeters [email protected] New Users to Excel 1 April 6th 07 03:54 PM
Find and replace part of a text string [email protected] Excel Discussion (Misc queries) 2 July 10th 06 10:34 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
Find/Replace String MysticalNomad Excel Programming 0 October 27th 04 11:59 AM


All times are GMT +1. The time now is 05:27 PM.

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"