+ Reply to Thread
Results 1 to 6 of 6

Find and Replace Macro Based on Specific Cells

  1. #1
    Registered User
    Join Date
    09-12-2009
    Location
    United States
    MS-Off Ver
    Excel 2019
    Posts
    7

    Find and Replace Macro Based on Specific Cells

    Hello all. After much fretting over this (and many other Excel issues), I've decided to seek out some assistance. I've included an example with columns, because I'm not very fluent in Excel terminology.

    Please Login or Register  to view this content.
    I want to create a macro that will take the text from A1 on worksheet 2, find that text on worksheet 1, then replace A2 on worksheet 1 with A2 on worksheet 2.

    In other words, I want the macro to (in this example), find "Alpha" in worksheet 1, then replace "Apple" on worksheet 1 with "Apricot" from worksheet 2.

    Apologies if this is not clear: I'm still having trouble expressing myself when it comes to Excel.
    Last edited by EvoDE; 09-12-2009 at 07:42 PM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Find and Replace Macro Based on Specific Cells

    Hi EvoDE
    Codes untested but try something like...
    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Find and Replace Macro Based on Specific Cells

    I suspect Pike has answered your question but could you explain this bit:

    Quote Originally Posted by EvoDE
    In other words, I want the macro to (in this example), find "Alpha" in worksheet 1, then replace "Apple" on worksheet 1 with "Apricot" from worksheet 2.
    I am presuming "able" in your screenshot should thus actually be "Alpha" else this doesn't make much sense ... (to me at least but it's early!)

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Find and Replace Macro Based on Specific Cells

    Thanks for the confindece DonkeyOte
    but the tested code should be..
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-12-2009
    Location
    United States
    MS-Off Ver
    Excel 2019
    Posts
    7

    Re: Find and Replace Macro Based on Specific Cells

    Arg, yeah I mixed up "Able" and "Alpha."

    Thanks very much for your help Pike. Your solution works beautifully. I'll now spend some time trying to understand *why* it works.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Find and Replace Macro Based on Specific Cells

    hey EvoDE
    can you go back to your fist post and click edit
    then choose advanced and change the prefix to solved

    the code is standard find replace code - it use to solve most find replace posts

+ 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