Results 1 to 6 of 6

More efficient (faster) sub-String method?

Threaded View

  1. #1
    Registered User
    Join Date
    09-16-2008
    Location
    Ottawa, Canada
    Posts
    29

    More efficient (faster) sub-String method?

    I have a piece of code that works very well but takes a long time. 1s per instance to be exact. My data is going to approach 3000 records so that translates into almost an hour to run through the entire data set.
    I am looking for code that will produce the same results but in much less time. Is it possible?

    Basically I have a Column that contains names with English and French acronyms separated by [space]/[space]. I need just the English acronym.

    Group Name:
    ABCDEFG / ABCGDF
    XYZ / ZXY
    ABC123 / CAB123

    Changes to....

    Group Name:
    ABCDEFG
    XYZ
    ABC123

    This is the code I am using:

        Dim SupGrpRange As Range
        For Each SupGrpName In Range("A3:A" & LastRow)
          a = SupGrpName.Text
          b = InStr(1, a, " /")
          If b > 0 Then
            SupGrpName.Value = RTrim(Left(a, b))
          End If
        Next
    Last edited by Bytor47; 06-12-2013 at 08:21 AM. Reason: Solved

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