PDA

View Full Version : Solved: changing cell value/mapping



Anomandaris
05-04-2009, 10:36 AM
Hi guys,

What I'm trying to do is change the cell values in a column based on a table in a second sheet.
As you can see in the workbook, there are 2 sheets, In Sheet 1 COlumn 2 there will be certain client codes, now these need to be changed into Our Internal codes. In Sheet 2 - I have a list that shows the corresponding client and internal codes....so basically I'm looking for a macro that will change the value in Sheet 1 by referring to Columns A and B in sheet 2. Somehow need to change all column A values into the Column B values.

I know I can do it using If-Then statements and Offset(0), but it gets really long as sometimes there's over 100 different ones..

Any help would be great ...thanks a bunch!

Bob Phillips
05-04-2009, 04:25 PM
Just add VLOOKUP(B2,Sheet2!A:B,2,FALSE) to A2 and copy down.

stanleydgrom
05-04-2009, 04:35 PM
Anomandaris,

See the attached workbook "Changing cell value mapping - Anomandaris - VP - SDG.xls" with macro "UpdateCodes".

Run the "UpdateCodes" macro.


Have a great day,
Stan

Anomandaris
05-05-2009, 11:41 AM
Awesome! you guys rock, both methods work. Thanks a lot Xld and Stanley