+ Reply to Thread
Results 1 to 3 of 3

Text Manipulation

  1. #1
    Registered User
    Join Date
    07-06-2005
    Posts
    15

    Text Manipulation

    Would like if the below result can be achievable and what method..

    Input data:

    Name
    Joemoe
    tyu456
    joe
    kiin
    froogle123
    gtyo
    froogle
    Tyu


    Desired result: To create unique ID..

    Name ID
    Joemoe 1
    tyu456 2
    joe 1
    kiin 3
    froogle123 4
    gtyo 5
    froogle 4
    Tyu 2

    Thanks.
    Jimmy

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    I believe that this macro will do what you want. If works by scanning down the column from top to bottom looking if it has seen the substring before.

    Sub Test()
    CurrentID = 0
    For N = 2 To Cells(65536, 1).End(xlUp).Row
    If Application.CountIf(Range(Cells(2, 1), Cells(N, 1)), Cells(N, 1) & "*") > 1 Then
    Cells(N, 2) = Range(Cells(2, 1), Cells(N - 1, 1)).Find(Cells(N, 1), Cells(2, 1), xlValues, xlPart).Offset(0, 1)
    Else
    CurrentID = CurrentID + 1
    Cells(N, 2) = CurrentID
    End If
    Next N
    End Sub
    Martin

  3. #3
    Registered User
    Join Date
    07-06-2005
    Posts
    15
    Mrice..Thanks.

    Works Great!!!!

    Jimmy

+ 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