Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
M M is offline
external usenet poster
 
Posts: 2
Default replace in a string

Hi,

I'm looking for a code which performs the following :
delete a string from another string :
example : tomorrow --- the m should be removed
--- output : toorrow

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default replace in a string

On Sun, 11 Sep 2005 10:22:56 GMT, "M" wrote:

Hi,

I'm looking for a code which performs the following :
delete a string from another string :
example : tomorrow --- the m should be removed
--- output : toorrow

Thanks


Look at HELP for the SUBSTITUTE worksheet function.

=SUBSTITUTE("tomorrow","m","")

will remove all of the "m"'s.


--ron
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default replace in a string

Public Sub ReplaceText()
Dim sVal As String

sVal = ActiveCell.Value
sVal = Replace(sVal, "m", "", 1, 1, vbBinaryCompare)
ActiveCell.Value = sVal

End Sub

Note 'vbBinaryCompare' makes it casesensitive


"M" wrote in message
...
Hi,

I'm looking for a code which performs the following :
delete a string from another string :
example : tomorrow --- the m should be removed
--- output : toorrow

Thanks



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
Edit REplace String Tami Excel Worksheet Functions 2 September 25th 09 08:20 PM
How do I replace last numeric string from a alphanumeric string? Christy Excel Discussion (Misc queries) 3 August 11th 06 12:17 AM
Find/Replace String MysticalNomad Excel Programming 0 October 27th 04 11:59 AM
replace a string in the worksheet thang Excel Programming 3 October 7th 04 06:30 PM
Substring to replace string Andrew Slentz[_2_] Excel Programming 1 June 11th 04 04:51 PM


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