Results 1 to 3 of 3

text split(regular expressions)

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-18-2015
    Location
    Republic of Korea
    MS-Off Ver
    2010
    Posts
    314

    text split(regular expressions)

    
    Sub SplitText()
    
        Dim r As Range
        Dim Matches As Object
        Dim matchCount As Integer
    
        Set r = Range("A1")
        
        With CreateObject("VBScript.RegExp")
            .Pattern = "\d+\s\D+"
            .Global = True
            
            Set Matches = .Execute(r.Value)
            
            For matchCount = 1 To Matches.Count
                r.Offset(matchCount + 1).Value = Matches(matchCount - 1)
            Next
            
        End With
        
    End Sub
    pattern is correct?

    Please advise the correct code.
    Attached Files Attached Files
    Last edited by chief_abound; 11-14-2015 at 01:10 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Regular Expressions in VBA
    By BS Singh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2014, 03:29 PM
  2. Regular Expressions in VBA
    By samualt in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-08-2011, 11:34 PM
  3. Regular Expressions
    By mattdick in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-07-2009, 06:33 PM
  4. Regular expressions
    By JeffMelton in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2006, 09:00 PM
  5. [SOLVED] Regular expressions in Excel
    By vigi98 in forum Excel General
    Replies: 3
    Last Post: 11-10-2005, 12:45 PM
  6. [SOLVED] Like Operator vs Regular Expressions
    By Chris W. in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2005, 06:06 AM
  7. Regular Expressions in VBA?
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-10-2005, 02:06 AM

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