+ Reply to Thread
Results 1 to 12 of 12

Cross-reference between cells

  1. #1
    Registered User
    Join Date
    12-27-2012
    Location
    Cluj-Napoca
    MS-Off Ver
    Excel 2010
    Posts
    14

    Cross-reference between cells

    i have an table with 92 columns filled with 65000 rows. Each cell contains 17 caracters (EX: 968743AB2C96ZA ) 968743 is a product code, AB2C96 is another product code that is a cross-reference to the first code, ZA is present in each line and after ZA are 3 blank spaces.

    65000X92 is a lot to check by hand.
    I need something to help me find the cross between a code when i need it.

    EX: i need to find ALL cross-references to code 968743 and give back the cross-reference for that code(meaning the MID(X,7,6) code).


    Is there any chance i can use Excel for what i need? If not will Access be any better?

  2. #2
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    Re: Cross-reference between cells

    Are you trying to say that, given a cell, where user put the code 968743, you would like to know in which cells (all 92 columns and 65000 rows) that have 968743 and what is the corresponding cross-reference (AB2C96)?

  3. #3
    Registered User
    Join Date
    12-27-2012
    Location
    Cluj-Napoca
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Cross-reference between cells

    yes.
    it needs to verify all codes that start with a code and reply all corresponding codes that are a cross-reference to that . I can cut those 92 columns and make 184 columns each with a 6 digit code(1 column is base code and 2-nd column is cross-code and so on). What i don't know is how to check all table for corresponding code for a given user code. Some codes may have 10 or more cross-code in the table.

  4. #4
    Registered User
    Join Date
    12-27-2012
    Location
    Cluj-Napoca
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Cross-reference between cells

    exemple cross.xlsUPDATE:
    i managed to split cells and now i have 184 columns with CODE CROSS CODE CROSS CODE CROSS pattern.


    The end result will be linked to other formulas and value but those i managed to make . I have problems with this one.
    Last edited by zepelin; 02-22-2013 at 07:45 AM.

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Cross-reference between cells

    Hi Zepelin,

    Try using below formula:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    enter using ctrl shift enter.


    see attached:- exemple cross.xlsx



    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  6. #6
    Registered User
    Join Date
    12-27-2012
    Location
    Cluj-Napoca
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Cross-reference between cells

    this is great. how can i change the formula if i have 184 columns and 65000 rows?

    the formula needs to check all 182 columns for that code i need to search. the code that is on column A can be again in column I or R or maybe Z(i have 182 columns)

    I don't know in what column my code is located when i want to search for him
    Last edited by zepelin; 02-22-2013 at 09:43 AM.

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Cross-reference between cells

    not sure about 184 columns.. since your example data was referring only to column A
    for rows, just change 14 to your last row number.


    Regards,
    DILIPandey
    <click on below * if this helps>

  8. #8
    Registered User
    Join Date
    12-27-2012
    Location
    Cluj-Napoca
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Cross-reference between cells

    i want to be able to input a code that can be found in any column marked "code"(there are 92 such columns) and right to each "code" column is a "cross" column. My xls table has 220mb so i can't post it here, i just cut few codes from there to see how my table is made

  9. #9
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Cross-reference between cells

    Okay. .. use the workbook I uploaded in post #5 and provide your scenario there.. thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>

  10. #10
    Registered User
    Join Date
    12-27-2012
    Location
    Cluj-Napoca
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Cross-reference between cells

    exemple cross.xlsxi uploaded first 2 columns and first 3 rows so you can see what i need. Because i can only upload 1mb i had to cut come rows(all columns have 65000 rows + 1 header
    the formula is needed on a new sheet because after i get the cross-reference i will link that code to future formulas.

  11. #11
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Cross-reference between cells

    Hi Zepelin,

    Used below macro in the attached file to achieve the desired results :-

    Please Login or Register  to view this content.
    See attached:- exemple cross.zip


    Regards,
    DILIPandey
    <click on below * if this helps>

  12. #12
    Registered User
    Join Date
    12-27-2012
    Location
    Cluj-Napoca
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Cross-reference between cells

    it works but takes ages to show a report. i need this to work because i want my work to be faster. I have the VBA acction below but by some mistake i don't get any results.


    =FindAll('toate echivalentele'!$A$1:$FZ$65000,123456,1)

    Where 123456 is the 6 digit code I want (can also be a cell reference like $A$1), and 1 is the columns offset from the found cell (1 to the right of the found cell)

    Function FindAll(r As Range, v As Variant, iOff As Integer) As Variant
    Dim c As Range
    Dim d() As Variant
    Dim firstAddress As String
    FindAll = ""
    ReDim d(1 To 1)
    With r
    Set c = .Find(v, LookIn:=xlValues, lookAt:=xlWhole)
    If Not c Is Nothing Then
    d(1) = c.Offset(0, iOff).Value
    firstAddress = c.Address
    Else
    End
    End If
    Set c = .Find(v, c, LookIn:=xlValues, lookAt:=xlWhole)
    If Not c Is Nothing Then
    If c.Address <> firstAddress Then
    Do
    ReDim Preserve d(1 To UBound(d) + 1)
    d(UBound(d)) = c.Offset(0, iOff).Value
    Set c = .Find(v, c, LookIn:=xlValues, lookAt:=xlWhole)
    Loop While Not c Is Nothing And c.Address <> firstAddress
    End If
    End If
    End With
    If Application.Caller.Rows.Count = 1 Then
    FindAll = d
    Else
    FindAll = Application.Transpose(d)
    End If
    End Function

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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