+ Reply to Thread
Results 1 to 9 of 9

Macro for multiFindandReplace btw sheets requiring multiple cells to match

  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Macro for multiFindandReplace btw sheets requiring multiple cells to match

    Hello!
    I require what I expect to be a lengthy macro to do the following:

    Cells to be replaced within SheetX, Section E2:BN135000
    Search within SheetY, Section A2:BP980000 (as you can see I'm dealing with a huge amount of data)

    I need the macro to go row by row. If any cell from Column A within SheetX matches SheetY, then it also needs to confirm within those same rows that Column B, C and D match up. If yes, then it will replace from SheetY cells E, F, G ..etc the cells from columns E, F, G, ... BO in SheetX.

    The rows #s do not need to match. So for example:

    In SheetX I will have multiple rows in Column A that say "Dog". So SheetX.Row25.ColumnA = "Dog" and SheetY.Row333.ColumnA = "Dog". Then it should confirm if Columns B, C and D from SheetX.Row25 and SheetY.Row333 also match up.
    If Yes, then SheetY.Row333.ColumnsF,G,H,K,L,M,O,T should replace SheetX.Row25.ColumnsF,G,H,K,L,M,O,T ....(also what if the columns are not together in a range and some need to be skipped? how could I implement that)

    Please help at all if you can. Most of the responses I have found so far on multiple find and replace don't provide much for cross refenencing and validating matching cells.

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Macro for multiFindandReplace btw sheets requiring multiple cells to match

    Hi
    It would help if you can provide a sample workbook suitable annotated with the before and after scenarios. That would help us to help you better.
    Tony

  3. #3
    Registered User
    Join Date
    06-18-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Macro for multiFindandReplace btw sheets requiring multiple cells to match

    That would be great if you could reivew it. I've saved a sample sheet here:

    https://drive.google.com/folderview?...Gc&usp=sharing

    InitialSheet1 is SheetX from my question and is the sheet I need updated. The macro will extract data from "CopyFrom" (SheetY) by cross comparing rows and making sure the first 4 cells match. If yes, then it will overwrite cells E:F. "PostMacroSheet1" is the end result after the macro has run.

    Thanks again!

  4. #4
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Macro for multiFindandReplace btw sheets requiring multiple cells to match

    Hi
    I am not in my office today so will look at it tomorrow for you. Based on the information provided we should be able to provide a formula for you rather than going down the VBA route.
    I will get back to you tomorrow.
    Tony

  5. #5
    Registered User
    Join Date
    06-18-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Macro for multiFindandReplace btw sheets requiring multiple cells to match

    Thanks Tony!

  6. #6
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Macro for multiFindandReplace btw sheets requiring multiple cells to match

    Hi
    Can you send me an actual Workbook rather than a link to an image and I can play around with it and test my theory before posting back to you.
    Thanks
    Tony

  7. #7
    Registered User
    Join Date
    06-18-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Macro for multiFindandReplace btw sheets requiring multiple cells to match

    Hi Tony,

    Sorry for the delay - I've been a little swamped. The link is a downloadable xls file. Google provides a "quickview" that may look like an image file, but it gives you the option to download. Please let me know if you have any issues.

    Thanks!
    Joanne

  8. #8
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Macro for multiFindandReplace btw sheets requiring multiple cells to match

    Hi Joanne

    I have been out of the country for a week which is why I have not responded. I am unable to download the file as you suggested, it only shows me an image. Presumably because is via an https site which I don't have access to.

    Tony

  9. #9
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Macro for multiFindandReplace btw sheets requiring multiple cells to match

    Hi Joanne
    I now have a copy of your workbook.
    Can you confirm exactly which columns need to match and which columns need to be overwritten.
    I will then see if I can help you.
    Tony

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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