+ Reply to Thread
Results 1 to 6 of 6

Find Value in 1 column based on another column then replace with value of yet another.

  1. #1
    Registered User
    Join Date
    12-27-2012
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    2

    Find Value in 1 column based on another column then replace with value of yet another.

    Hi All Guru's

    Ok what I have is an excel csv (XLS) for this forum.

    I have column J with city names without duplicates also Column I with the number of the city in Column J

    Now in column C I have cities (B and C is the same just for me to have a copy of C when values is changed)

    I would like C to find the values in J and then replace C with the Number in I.

    This is just a sample file, C has about 12000 rows in the complete file.

    Will something like this be possible ?

    On another thread I found something similar than what I wanted to do, but I can't get the code to work, I keep getting errors.
    Im not sure if Im allowed to link to the thread , but Im gonna try : http://www.excelforum.com/excel-prog...n-another.html

    Thank you all.

    Johan
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Find Value in 1 column based on another column then replace with value of yet another.

    hi Johan, welcome to the forum. a formula would do the the job in C2 dragged down.
    =INDEX($I$2:$I$1438,MATCH(B2,$J$2:$J$1438,0))

    or do you absolutely need VBA code for this? my VBA skills are limited, so my codes would revolve around a formula too

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Find Value in 1 column based on another column then replace with value of yet another.

    One way

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Find Value in 1 column based on another column then replace with value of yet another.

    Another way thats a little faster

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-27-2012
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    2

    Re: Find Value in 1 column based on another column then replace with value of yet another.

    Hi Mike,

    Thank you for the script, I don't know how it works, but it works amazing!!!!!!

    Do you mind If I come to you with some other problems ?

    Thank you very much!!!

    Johan

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Find Value in 1 column based on another column then replace with value of yet another.

    Your welcome. Sure no problem

  7. #7
    Registered User
    Join Date
    12-27-2012
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    2

    Re: Find Value in 1 column based on another column then replace with value of yet another.

    Hi Mike,

    Im trying to send you a PM but Im not sure if it is going through.

    Please let me know if you did receive it.

    Thank you,

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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