+ Reply to Thread
Results 1 to 5 of 5

Delete value in a string

Hybrid View

  1. #1
    Todd Huttenstine
    Guest

    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


  2. #2
    Bob Phillips
    Guest

    Re: 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" <todd.huttenstine@verizonwireless.com> wrote in message
    news:1138726798.547656.179750@o13g2000cwo.googlegroups.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
    >




  3. #3
    Gary''s Student
    Guest

    RE: 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
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: 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 are:
    =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" <GarysStudent@discussions.microsoft.com> wrote in message
    news:017C42D9-5FB0-4E6F-A84A-714EEFDA105B@microsoft.com...
    > 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
    > >
    > >




  5. #5
    Ken Wright
    Guest

    Re: 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" <todd.huttenstine@verizonwireless.com> wrote in message
    news:1138726798.547656.179750@o13g2000cwo.googlegroups.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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1