+ Reply to Thread
Results 1 to 5 of 5

Find a string by VBA Regular Expression and replace a part of that string

  1. #1
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Find a string by VBA Regular Expression and replace a part of that string

    Hi All,

    I would like to find ; (semicolon) which does not contain double quote on both side of it in an excel range (say- A1 to A10).
    Then all [any character] ; [any character] should replace with [that character] - [that character].

    Examples:

    a;b ---> a-b
    a; b ---> a- b
    a ;b ---> a -b
    a12c;d25dd ---> a12c-d25dd
    a123;425dd ---> a123-425dd
    a123";"325dd ---> a123";"325dd (No change)
    a123;"325dd ---> a123;"325dd (No change)
    a123";325dd ---> a123";325dd (No change)

    Thanks in advance for your support.

    Regards
    taps

  2. #2
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Find a string by VBA Regular Expression and replace a part of that string

    Why to use just RegEx? another method can't be used?

  3. #3
    Forum Contributor
    Join Date
    12-31-2012
    Location
    Jhang, Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    250

    Re: Find a string by VBA Regular Expression and replace a part of that string

    Please Login or Register  to view this content.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Find a string by VBA Regular Expression and replace a part of that string

    perhaps
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Find a string by VBA Regular Expression and replace a part of that string

    Should be
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: Find a string by VBA Regular Expression and replace a part of that string

    Hi hafizimran/JosephP/jindon

    Thanks a ton for your valuable support. All codes provided here is working fine

    Regards
    taps

+ 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