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
Bookmarks