Matching data in spreadsheet columns

C

Chris Hankin

Hello, could someone please help me with the following?

In column A I have text data - example:

Cell A1: Part Numbers (Title cell only)

Cells A2 to A5500 contain all the part numbers.

Cell A2: 001T66LMK
Cell A3: 002567U39-YY66
Cell A4: A-7-BB8
Cell A5: C857-H96-JA
Cell A6: E001-G7419300
Cell A7: FFFG96-001
Cell A8: J8-007-002
Cell A9: KLUY-F56
Cell A10: M002-776-UU

In column D I wish to copy 'n' paste some part numbers from another
workbook and match them up with the same part numbers listed in column
A. Example:

Cell D1: Imported Part Numbers (Title cell only)

Cell D2: (cell value is blank as there is no match)
Cell D3: 002567U39-YY66
Cell D4: A-7-BB8
Cell D5: C857-H96-JA
Cell D6: (cell value is blank as there is no match)
Cell D7: (cell value is blank as there is no match)
Cell D8: J8-007-002
Cell D9: KLUY-F56
Cell D10:(cell value is blank as there is no match)

Please note that the quantity of part numbers listed in column A is 5500
and the quantity of part numbers I am trying to copy 'n' paste into
column D is 437. As shown in the above example, I need the part numbers
I am pasting in column D to automatically populate the cell in column D
that matches the same part number in column A. I hope this is not too
confusing :)

As shown in my example, Cells D3, D4, D5, D8 & D9 were populated because
their values matched those found in column A.

Any help would be greatly appreciated.

Kind regards,

Chris.
 
M

Mark Ivey

You might be better off staying with the VLookup function outside of VBA.

But you could also consider using the same VLookup in your code it that was
a requirement.

To get the general idea on how to reference a worksheet function, take a
look at the following site:

http://www.exceltip.com/st/Worksheet_functions_in_VBA_macros_using_VBA_in_Microsoft_Excel/534.html

Once you have this down, you could also apply a worksheet function for the
VLookup in your VBA code. If you need detailed help, please reply and I will
see what I can come up with later today/tonight.


Just a thought.

Mark Ivey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top