Results 1 to 7 of 7

Delete some characters

Threaded View

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

    Re: Delete some characters

    Ahhhh, I thought you just wanted to replace Become to "".....

    try
    Sub test()
        Dim a, i As Long, temp
        With Range("a2", Range("a" & Rows.Count).End(xlUp))
            a = .Value
            ReDim Preserve a(1 To UBound(a, 1), 1 To 2)
            With CreateObject("VBScript.RegExp")
                .Pattern = "^(\d+),\d+,""([^""\d]+).+"
                For i = 1 To UBound(a, 1)
                    temp = a(i, 1)
                    If .test(temp) Then
                        a(i, 1) = .Replace(temp, "$1")
                        a(i, 2) = .Replace(temp, "$2")
                    End If
                Next
            End With
            .Resize(, 2).Value = a
        End With
    End Sub
    Attached Files Attached Files
    Last edited by jindon; 10-20-2012 at 08:45 AM.

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