+ Reply to Thread
Results 1 to 7 of 7

Run a search and replace based on what is in another Cell?

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    waco, texas
    MS-Off Ver
    Excel 2003
    Posts
    6

    Run a search and replace based on what is in another Cell?

    Basically I have two sheets.

    Sheet 1 changes monthly. It has a list of names in column A and their associated emails in column B. New Names and Emails are added and taken off and existing emails change.
    Sheet 2 comes in daily and has just the list of names.

    I need to figure out a macro that will look at sheet 1, look at a cell in column A, take the name that is in that cell.
    Search for that name in Sheet 2, then replace that name in sheet 2 with the email(column B) from sheet 1 associated with that name.


    It's quite all right if I need to merge the two sheets to accomplish this, but it would be preferable to keep them separate.
    Last edited by cekenney; 09-28-2012 at 12:20 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Run a search and replace based on what is in another Cell?

    Hello there,

    When do you want this action to take place? On change of a cell in worksheet 1, on add new worksheet?, on button press?

    Thanks!

  3. #3
    Registered User
    Join Date
    09-28-2012
    Location
    waco, texas
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Run a search and replace based on what is in another Cell?

    Really just when the macro is run. So on a shortcut key press or a button would work as well.

  4. #4
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Run a search and replace based on what is in another Cell?

    very bad code, but it works ^^

    Please Login or Register  to view this content.
    Last edited by Bishonen; 09-28-2012 at 02:54 PM.

  5. #5
    Registered User
    Join Date
    09-28-2012
    Location
    waco, texas
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Run a search and replace based on what is in another Cell?

    Quote Originally Posted by Bishonen View Post
    very bad code, but it works ^^

    Please Login or Register  to view this content.
    How would I change this if I simply wanted to do it from 2 different sheets within the same workbook?

  6. #6
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Run a search and replace based on what is in another Cell?

    Quote Originally Posted by cekenney View Post
    How would I change this if I simply wanted to do it from 2 different sheets within the same workbook?
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-28-2012
    Location
    waco, texas
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Run a search and replace based on what is in another Cell?

    wow! worked like a charm thanks so much!

+ 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