+ Reply to Thread
Results 1 to 4 of 4

Cross Reference Numbers Help

Hybrid View

  1. #1
    Registered User
    Join Date
    07-12-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Cross Reference Numbers Help

    I am trying to figure out a quicker way of cross referencing numbers and hoping someone might be able to help. In column "A" is the number that groups the numbers in Column "B" together and Column "C" would be the result of the cross reference. Does anyone know a way I could make this more automatic? Thanks in advance for the help.

    A B C
    706 T013 T113,T713
    706 T113 T013,T713
    706 T713 T013,T113

    708 T005 T105,T705
    708 T105 T005,T705
    708 T705 T005,T105
    Last edited by Jeff73; 09-25-2014 at 10:55 AM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Cross Reference Numbers Help

    With your Data starting in "A1" , Try this for results in column "C".
    Sub MG25Sep15
    Dim Dn          As Range
    Dim Rng         As Range
    Dim Dic         As Object
    Dim k           As Variant
    Dim Str         As String
    Dim n           As Long
    Dim nn          As Long
        
       Set Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
     Set Dic = CreateObject("Scripting.Dictionary")
        Dic.CompareMode = 1
       For Each Dn In Rng
                If Not Dic.exists(Dn.Value) Then
                    Set Dic(Dn.Value) = CreateObject("Scripting.Dictionary")
                End If
             Set Dic(Dn.Value)(Dn.Offset(, 1).Value) = Dn
        Next Dn
       
        For Each k In Dic.keys
            For n = 0 To Dic(k).Count - 1
                For nn = 0 To Dic(k).Count - 1
                    If Not Dic(k).keys()(n) = Dic(k).keys()(nn) Then
                        Str = Str & "," & Dic(k).keys()(nn)
                    End If
                Next nn
                 Dic(k).Item(Dic(k).keys()(n)).Offset(, 2).Value = Mid(Str, 2): Str = ""
           Next n
      Next k
    End Sub
    Regards Mick

  3. #3
    Registered User
    Join Date
    07-12-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Cross Reference Numbers Help

    Mick

    Thank you so much for the help! It worked perfectly!!

    Again, thank you for your help.

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Cross Reference Numbers Help

    You're welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Cross reference with multiple instances in reference data
    By Nick F in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-08-2013, 10:31 AM
  2. How to cross reference two columns of numbers
    By Danexcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2010, 09:52 AM
  3. Cross-reference Date with Numbers
    By mckoy_1 in forum Excel General
    Replies: 7
    Last Post: 07-31-2007, 04:11 PM
  4. Cross Reference Part Numbers
    By Chuck N in forum Excel General
    Replies: 5
    Last Post: 09-18-2006, 08:53 PM
  5. Replies: 1
    Last Post: 02-11-2005, 01:06 PM

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