Consulting

Results 1 to 4 of 4

Thread: Solved: changing cell value/mapping

  1. #1
    VBAX Tutor
    Joined
    Mar 2009
    Posts
    227
    Location

    Solved: changing cell value/mapping

    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!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Just add VLOOKUP(B2,Sheet2!A:B,2,FALSE) to A2 and copy down.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Nov 2006
    Location
    North East Pennsylvania, USA
    Posts
    203
    Location
    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

  4. #4
    VBAX Tutor
    Joined
    Mar 2009
    Posts
    227
    Location
    Awesome! you guys rock, both methods work. Thanks a lot Xld and Stanley

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •