Results 1 to 14 of 14

Matching up two lists of codes using VBA

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-19-2013
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    297

    Matching up two lists of codes using VBA

    I am trying to avoid using formulas here so need a VBA solution.

    I am trying to match up two lists of product codes and their respective bar codes.

    (I have added an example workbook to explain the problem)

    In Sheet1 I have the following:

    Product Codes...........Bar Codes
    PCode 1.....................Bar code 1
    PCode 2.....................Bar code 2
    PCode 3.....................Bar code 3
    PCode 4.....................Bar code 4

    And in sheet 2 i have the same product codes except they have a four character suffix added on - and different bar codes in column 2.

    So where a product code on sheet 1 would be 'product-code-1' on sheet 2 it would be 'product-code-1-abc'

    I am trying to write a VBA code that will ignore the last four characters of the product codes on sheet2 and match them to those sheet1, and where there is a match copy the relevant barcode from sheet2 to third column on Sheet1. So it would be

    Codes.................Bar Codes..........Bar Codes from Sheet2
    PCode 1.....................Bar code 1............Bar code 1
    PCode 2.....................Bar code 2............Bar code 2
    PCode 3.....................Bar code 3............Bar code 3
    PCode 4.....................Bar code 4............Bar code 4

    I have been struggling with this for a few days so any help anyway can offer would be much appreciated
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Matching post codes to areas
    By radmar1985 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-08-2013, 09:38 AM
  2. Matching Zip Codes to Geographic Region
    By dforte in forum Excel General
    Replies: 3
    Last Post: 10-03-2011, 05:48 PM
  3. Matching codes and data into one row
    By darell in forum Excel General
    Replies: 1
    Last Post: 08-01-2011, 02:23 AM
  4. Codes for Matching HSCodes
    By RAparente in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-02-2008, 01:55 AM
  5. matching codes between 2 item codes
    By JChan in forum Excel General
    Replies: 1
    Last Post: 10-15-2005, 01:05 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