ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete value in a string (https://www.excelbanter.com/excel-programming/351959-delete-value-string.html)

Todd Huttenstine

Delete value in a string
 
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


Bob Phillips[_6_]

Delete value in a string
 
See previous post

=SUBSTITUTE(A1,"7D: ","")

in the light of other posts

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Todd Huttenstine" wrote in message
oups.com...
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




Gary''s Student

Delete value in a string
 
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



Tom Ogilvy

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





Ken Wright

Delete value in a string
 
Just select all the data and do Edit / Replace, Replace '7D: ' (No quotes)
with nothing.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

------------------------------*------------------------------*----------------
It's easier to beg forgiveness than ask permission :-)
------------------------------*------------------------------*----------------



"Todd Huttenstine" wrote in message
oups.com...
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





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com