View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Delete value in a string

What did you mean by

Use the =REPLACE() function:


showing it as a worksheet function. The arguments for the Replace worksheet
function a
=REPLACE(old_text,start_num,num_chars,new_text)

Did you mean the worksheetfunction Substitute instead or were you actually
refering to the Replace VBA function (introduced in xl2000) which you later
demo'd in your code and not intending to imply a worksheet solution at all?

Or is there a third interpretation?

Just confusing what you meant.

--
Regards,
Tom Ogilvy


"Gary''s Student" wrote in message
...
Use the =REPLACE() function:


Sub Macro1()
Dim s As String
s = "ab"
s = Replace(s, "a", "")
MsgBox (s)
End Sub
--
Gary's Student


"Todd Huttenstine" wrote:

I have the following string:
"7D: test messages"

I would like to remove the value "7D: " from the string

How do I do this?



Thanks