+ Reply to Thread
Results 1 to 4 of 4

Lookup cell contents on another workbook and replace if found

  1. #1
    Forum Contributor
    Join Date
    07-01-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2016
    Posts
    161

    Lookup cell contents on another workbook and replace if found

    I have a workbook with a worksheet that contains multiple rows and columns with text. What I would like to do is run a script that will:
    1. try to match the contents of the cell with column A of MATCH worksheet on a different workbook
    2. If the item has a match (lets say it matches A31), then replace that cell's content with B31 from the MATCH worksheet.


    The copy should be value only - no formatting, etc. The MATCH worksheet could also just be a text file if that makes things easier.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Lookup cell contents on another workbook and replace if found

    This is untested:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    07-01-2009
    Location
    Maine, USA
    MS-Off Ver
    Excel 2016
    Posts
    161

    Re: Lookup cell contents on another workbook and replace if found

    Thanks xladept. That was what I was looking for. I was unsure if the better method was using dictionary objects, but this works fine. With slight modifications, I prompt for the both workbooks and worksheets.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Lookup cell contents on another workbook and replace if found

    You're welcome, glad it worked since I didn't test it!

+ 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. Replace data in secondary workbook if duplicate found
    By fenfool in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2015, 08:21 PM
  2. Macro to search cells for substring and replace contents of cell if substring is found
    By robbyvegas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2015, 06:40 AM
  3. Find and Replace the contents of one cell with the contents of another
    By thechevs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2014, 06:48 AM
  4. Seperate Cell contents when space is found
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2012, 08:59 PM
  5. Replies: 6
    Last Post: 03-14-2012, 01:01 AM

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