+ Reply to Thread
Results 1 to 12 of 12

Macro to match part number and serial numbers

  1. #1
    Registered User
    Join Date
    11-01-2018
    Location
    Denver
    MS-Off Ver
    Microsoft Office 2016
    Posts
    6

    Macro to match part number and serial numbers

    Hello,

    This is my first post on this forum so please excuse any errors or shortcomings. I am attempting to create a load file for an aircraft engine. The engine consists of roughly 950 part number but I am only concerned with 94 of those part numbers.

    I am asking for assistance creating a macro that would match the part numbers in two columns (B) & (AL) and determine if the 94 parts numbers found in (B) are found in (AL).

    IF the part number from (B) is found in (AL), then return the corresponding serial number (AM) into column (C). I've been able to create a macro for the first match: =ISNUMBER(MATCH(B2,AL:AL,0))

    Help with this would be of tremendous help! I've attached a snip of the excel file I am using.

    Respectfully,

    Derrik Bowen
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,546

    Re: Macro to match part number and serial numbers

    Instead of a picture (macros are very difficult to try on a picture), attach a short version of your actual workbook with preferably before and afters.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,128

    Re: Macro to match part number and serial numbers

    You can do that with a formula, not need for VBA.

    =INDEX(AL$2:AM$100,MATCH(B2,AL$2:AL$100,0),1)

  4. #4
    Registered User
    Join Date
    11-01-2018
    Location
    Denver
    MS-Off Ver
    Microsoft Office 2016
    Posts
    6

    Re: Macro to match part number and serial numbers

    Hello folks,

    A copy of the workbook is attached. Thank you!

    Derrik Bowen

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,128

    Re: Macro to match part number and serial numbers

    How about
    =IFERROR(INDEX(AL$2:AM$305,MATCH(B4,AL$2:AL$305,0),1),"Not found")

  6. #6
    Registered User
    Join Date
    11-01-2018
    Location
    Denver
    MS-Off Ver
    Microsoft Office 2016
    Posts
    6

    Re: Macro to match part number and serial numbers

    Hello Fluff13,

    Thank you very much for your response! The formula did not return the desired result as the serial numbers (if found) from (AM) did not populate (C). I am pasting the formula into column (A), is that correct?

    Derrik Bowen

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,128

    Re: Macro to match part number and serial numbers

    It needs to go in C2 & fill down.

  8. #8
    Registered User
    Join Date
    11-01-2018
    Location
    Denver
    MS-Off Ver
    Microsoft Office 2016
    Posts
    6

    Re: Macro to match part number and serial numbers

    Hello again,

    =IFERROR(INDEX(AL$2:AM$305,MATCH(B4,AL$2:AL$305,0),1),"Not found") is not returning the desired result when pasted into column (A) or (C). Thank you!

    Derrik Bowen

  9. #9
    Registered User
    Join Date
    11-01-2018
    Location
    Denver
    MS-Off Ver
    Microsoft Office 2016
    Posts
    6

    Re: Macro to match part number and serial numbers

    When pasted into C2, part numbers populate column C incorrectly

    Derrik Bowen

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,128

    Re: Macro to match part number and serial numbers

    Oops, typo in the formula, it should be
    =IFERROR(INDEX(AL$2:AM$305,MATCH(B2,AL$2:AL$305,0),2),"Not found")

  11. #11
    Registered User
    Join Date
    11-01-2018
    Location
    Denver
    MS-Off Ver
    Microsoft Office 2016
    Posts
    6

    Re: Macro to match part number and serial numbers

    BOOM THERE IS IT! THANK YOU! I cannot express how helpful your time was today

    Derrik Bowen

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,128

    Re: Macro to match part number and serial numbers

    Glad to help & thanks for the feedback

+ 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. match serial numbers
    By gogita_79 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-07-2017, 04:19 PM
  2. [SOLVED] Match serial date (year) to number list 2000
    By JO505 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-20-2015, 05:42 PM
  3. Match serial date (year) to number list 2000
    By JO505 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2015, 02:08 PM
  4. [SOLVED] Return all numbers from serial number
    By ScottLor in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-02-2013, 05:28 PM
  5. Replies: 6
    Last Post: 10-22-2012, 05:15 PM
  6. Using Match and Index to highlight serial numbers
    By johnmcquay in forum Excel General
    Replies: 1
    Last Post: 05-29-2012, 01:56 PM
  7. Finding a serial number in a list of serial numbers
    By zocoloco in forum Excel General
    Replies: 2
    Last Post: 02-04-2009, 05:20 AM

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