+ Reply to Thread
Results 1 to 11 of 11

replace values between specific characters

Hybrid View

hluk replace values between... 11-29-2009, 04:02 AM
mikerickson Re: replace values between... 11-29-2009, 05:10 AM
hluk Re: replace values between... 11-29-2009, 04:53 PM
mikerickson Re: replace values between... 11-29-2009, 06:01 PM
hluk Re: replace values between... 11-29-2009, 06:19 PM
mikerickson Re: replace values between... 11-29-2009, 07:54 PM
hluk Re: replace values between... 11-29-2009, 08:51 PM
hluk Re: replace values between... 11-30-2009, 03:05 PM
hluk Re: replace values between... 12-01-2009, 01:33 PM
mikerickson Re: replace values between... 12-01-2009, 04:46 PM
hluk Re: replace values between... 12-01-2009, 05:39 PM
  1. #1
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: replace values between specific characters

    My mistake
    If Left(Snippets(i), 1) <> "<" Then
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  2. #2
    Registered User
    Join Date
    07-09-2008
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    91

    Re: replace values between specific characters

    thanks again! error is gone

    but, the returned value is now #NAME? or 0?
    input string is
    <randomstring testing number 444 <randomstring user number 8394 <!code… activated account
    and formula used is:
    =RemoveBrackets(A2)
    the code i am using:
    Function RemoveBrackets(aString As String) As String
        Dim i As Long, Snippets As Variant
        Snippets = Split(aString, " ")
        For i = 0 To UBound(Snippets) Step 2
            If Left(Snippets(i), 1) <> "<" Then
                RemoveBrackets = RemoveBrackets & Snippets(i)
            End If
        Next i
    End Function

  3. #3
    Registered User
    Join Date
    07-09-2008
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    91

    Re: replace values between specific characters

    i tried to change the code some more... but it's not working out. arrrrr, ahahah, this coding stuff is not as easy as it seems.

  4. #4
    Registered User
    Join Date
    07-09-2008
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    91

    Re: replace values between specific characters

    is there a find/replace string that can do this?

    for example, is there a wildcard character that can be used to represent the characters within the string?

    e.g.) "<*******(space)"

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: replace values between specific characters

    You might try this
    Function RemoveBrackets(aString As String) As String
        Dim i As Long, Snippets As Variant
        Snippets = Split(aString, " ")
        For i = 0 To UBound(Snippets) 
            If Left(Snippets(i), 1) <> "<" Then
                RemoveBrackets = RemoveBrackets & Snippets(i) & " "
            End If
        Next i
        RemoveBrackets = Trim(RemoveBrackets)
    End Function
    That find/Replace might work too.

  6. #6
    Registered User
    Join Date
    07-09-2008
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    91

    Re: replace values between specific characters

    the code above... WORKS!

+ 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