+ Reply to Thread
Results 1 to 4 of 4

Find and replace multiple values within individual cells

  1. #1
    Registered User
    Join Date
    03-10-2014
    Location
    MD
    MS-Off Ver
    Excel 2003
    Posts
    2

    Find and replace multiple values within individual cells

    I'm new to this forum/advanced excel, so please forgive any errors.

    So I have a list of organizations in Column A, with multiple names (anywhere from 0 to 50 names) for each org. in Column B.

    Org Names
    Company A Brown, Jones, Smith, West
    Company B Brown, Evans, Smith

    Separately, I have a list of corresponding values for each name:

    Brown Red
    Jones Red
    Smith Blue
    Etc. Etc.

    I want to do a find and replace for all of Column B, where all the names are replaced with their respective color values. If possible, I'd like this to all happen with the individual cells (so for example, B3 might go from "Brown, Jones, Smith" to "Red, Red, Blue").

    If that's not possible, I could divide all the names into individual cells and then find and replace.

    Is what I want feasible? Am I making any sense? Thanks for any help.
    Last edited by phbeats; 03-14-2014 at 03:47 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Find and replace multiple values within individual cells

    If there are too many names to do this manually with Find & Replace, then a short VBA macro would do it. Note that the code has to avoid scenarios like this:

    Rumpelstiltskin Brown
    Brown Red
    Jones Red
    Smithe Green
    Smith Blue

    If you replace all Rumpelstiltskins first, then replace all Browns, then Rumpelstiltskin will end up a Red instead of Brown.

    If you do a simple find & replace, then Smithe ends up as Bluee and never becomes Green.

    I have attached a solution based on your sample data.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-10-2014
    Location
    MD
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Find and replace multiple values within individual cells

    That worked, thank you! It would stop if it reached a blank cell, but I sorted so that all the ones with content were consecutive and it worked great. Thanks again, this saved me hours of work!

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Find and replace multiple values within individual cells

    You're welcome! Thanks for the rep, and thanks for marking your thread Solved!

+ 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. [SOLVED] VBA Find & Replace Multiple Values
    By hobbiton73 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2013, 03:54 AM
  2. [SOLVED] Faster way to find and replace multiple values with corresponding values
    By babbeleme1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-18-2013, 06:50 PM
  3. Replies: 2
    Last Post: 05-12-2011, 01:34 PM
  4. Find and Replace values from multiple lookup values
    By Gregula82 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2007, 03:12 PM
  5. find and replace multiple values
    By nikki115 in forum Excel General
    Replies: 1
    Last Post: 09-13-2006, 01:41 PM

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