+ Reply to Thread
Results 1 to 5 of 5

Replace values based on from-to pairs

  1. #1
    Registered User
    Join Date
    08-07-2011
    Location
    Shangri La
    MS-Off Ver
    Excel 2003
    Posts
    5

    Replace values based on from-to pairs

    I have a named range ("replace_lookup") that has 2 columns: "from" and "to". I would like a macro that loops through the named range and replaces all values in column C of the "main" worksheet with the related "to" value. Can anyone help?

  2. #2
    Registered User
    Join Date
    08-07-2011
    Location
    Shangri La
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Replace values based on from-to pairs

    NVM, I think I've got it.

    Please Login or Register  to view this content.
    Last edited by sugargenius; 01-10-2018 at 08:00 PM.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Replace values based on from-to pairs

    Or maybe just:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    08-07-2011
    Location
    Shangri La
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Replace values based on from-to pairs

    That looks a lot more elegant than my solution. Can you explain how it works? It's not obvious to me how it searches every cell in column C and makes a replacement...

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Replace values based on from-to pairs

    It just overwrites the column C value with the column B value - that seems to be what you're doing

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 10-21-2016, 06:16 PM
  2. [SOLVED] Replace values in rows based on criteria in column B
    By Marq555 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-03-2015, 10:25 AM
  3. Replace column values based on a list
    By bigroo1958 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2014, 07:12 AM
  4. Replace Contents of Cells Based on Values of Another
    By Babio1964 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-27-2013, 07:12 AM
  5. How to lookup values between a delimiter and replace based on range?
    By cda in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-06-2011, 04:34 PM
  6. Mulitple Find and replace pairs in one go
    By hmalone in forum Excel General
    Replies: 4
    Last Post: 02-23-2007, 11:08 AM

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