+ Reply to Thread
Results 1 to 3 of 3

Graciously requesting assistance aligning columns based on identical data in cells

Hybrid View

roking Graciously requesting... 11-08-2012, 01:02 PM
nilem Re: Graciously requesting... 11-08-2012, 01:22 PM
roking Re: Graciously requesting... 11-08-2012, 01:34 PM
  1. #1
    Registered User
    Join Date
    11-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Graciously requesting assistance aligning columns based on identical data in cells

    Excel 2010

    I have 3 lists of user names:

    List 1 - Active Employees - 1200 items
    List 2 - Active Email Addresses - 2200 items
    List 3 - Active AD accounts - 4400 items

    I am trying to align the columns to match like data.

    EX:
    current
    A B C
    1 a b b
    2 b c d
    3 c f e
    4 d j f
    5 e k k

    desired
    A B C
    1 a * *
    2 b b b
    3 c c *
    4 d * d
    5 e * e
    6 * f f
    7 * j *
    8 * k k

    So far all of my attempts have failed, as there is not always a match; a name may appear in only one column.

    My methodology may be flawed; if anyone has any suggestions, it would be very appreciated.

    I have uploaded a small sample of the data.
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Graciously requesting assistance aligning columns based on identical data in cells

    maybe so
    Sub ertert()
    Dim x, y(), i&, j&, k&
    x = Sheets("Sheet1").Range("A1").CurrentRegion.Value
    ReDim y(1 To UBound(x) * 3, 1 To 3)
    With CreateObject("Scripting.Dictionary")
        .CompareMode = 1
        For i = 1 To UBound(x)
            For j = 1 To UBound(x, 2)
                If .Exists(x(i, j)) Then
                    y(.Item(x(i, j)), j) = x(i, j)
                Else
                    k = k + 1: .Item(x(i, j)) = k
                    y(k, j) = x(i, j)
                End If
            Next j
        Next i
    End With
    With Sheets("Sheet2").Range("A1").CurrentRegion
        .ClearContents: .Resize(k, UBound(x, 2)).Value = y()
        .Parent.Activate
    End With
    End Sub
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Graciously requesting assistance aligning columns based on identical data in cells

    Thank you for the response.

    You are a beautiful human being; worked perfectly. /bow

+ 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