+ Reply to Thread
Results 1 to 8 of 8

More help on Find and Replace from one sheet to the next

  1. #1
    Registered User
    Join Date
    06-26-2019
    Location
    California, US
    MS-Off Ver
    Office 365
    Posts
    36

    More help on Find and Replace from one sheet to the next

    I'm trying to find and replace cells by looking at a value from one sheet, and replacing it with a value from another sheet.
    I'm currently modifying a code from my last thread by jolivanes (thank you!)

    I think I'm running into an issue using this code because some of the cells are combined, so it's not properly searching down the column. But I'm not sure.

    The code should:
    1. Find a name from (Sheet 1 column A) in (Sheet 2 column E)
    2. If it's found, then replace (Sheet 2 Column K, same row) with the value from (Sheet 1 column B, same row)

    Please Login or Register  to view this content.
    I've attached a sample worksheet to give you an idea of how the values might look.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: More help on Find and Replace from one sheet to the next

    Test my solution.
    HTML Code: 
    Attached Files Attached Files
    Best Regards,
    Maras.

  3. #3
    Registered User
    Join Date
    06-26-2019
    Location
    California, US
    MS-Off Ver
    Office 365
    Posts
    36

    Re: More help on Find and Replace from one sheet to the next

    Quote Originally Posted by maras_mak View Post
    Test my solution.
    Thanks Mara. The solution works on the sample sheet but didn't work on my actual one. The only thing I changed was all instances of (s2) to (s4) and Set s4 as Worksheets("Sheet4")

    I get a "Runtime Error '9': Subscript out of range" on the highlighted line.
    Please Login or Register  to view this content.
    I forgot to mention that the values in Sheet 1 may have random blanks or missing values in it. I'm not sure if that will cause the code to fail.

  4. #4
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: More help on Find and Replace from one sheet to the next

    Attach a small sample Excel workbook (10-20 rows of data).
    Make sure that your sample data are truly REPRESENTATIVE of your real data.
    The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

  5. #5
    Registered User
    Join Date
    06-26-2019
    Location
    California, US
    MS-Off Ver
    Office 365
    Posts
    36

    Re: More help on Find and Replace from one sheet to the next

    Ok here's a better sample workbook.

    Thank you very much!
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,542

    Re: More help on Find and Replace from one sheet to the next

    You could try this (use from either sheet)
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: More help on Find and Replace from one sheet to the next

    Haaaa, this is a completely different data layout and it should not work well !!!
    Maybe it will be fine now.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-26-2019
    Location
    California, US
    MS-Off Ver
    Office 365
    Posts
    36

    Re: More help on Find and Replace from one sheet to the next

    Thank you! The solution worked perfectly!

+ 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] Find and replace from one sheet to another.
    By Newbuilder in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-26-2017, 11:09 AM
  2. Multiple Find/Replace on a specified sheet and outputtingin a separe sheet
    By scfn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-24-2013, 07:27 AM
  3. Multiple find and replace from Glossary sheet to the active sheet
    By Chandru71 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-22-2011, 12:34 PM
  4. how to Find and Replace using different excel sheet?
    By rythem_of_the_nig in forum Excel General
    Replies: 1
    Last Post: 08-30-2011, 06:38 AM
  5. Find/Replace on a protected sheet
    By LAF in forum Excel General
    Replies: 1
    Last Post: 07-10-2009, 09:32 PM
  6. Find/Replace on a protected sheet
    By LAF in forum Excel General
    Replies: 1
    Last Post: 06-23-2009, 07:39 AM
  7. trying to find #REF! in a formula to replace with a sheet name
    By funkymonkUK in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-28-2006, 06:25 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