+ Reply to Thread
Results 1 to 4 of 4

Compare cells and replace value

  1. #1
    Registered User
    Join Date
    12-07-2014
    Location
    Qatar
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    10

    Smile Compare cells and replace value

    Hi ,
    May I ask you for an help in Excel?
    Suppose I have two excel workbooks having two columns A & B in each.
    I want to compare the value of A in one book with the value of A in the second book and if both are equal then replace value of B in second with value of B in first book.
    How do I do it?

    Regards
    Thomas

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,715

    Re: Compare cells and replace value

    Hi Thomas
    try this
    it assumes that both sets of values are in the first sheet on their respective workbooks

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-07-2014
    Location
    Qatar
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    10

    Re: Compare cells and replace value

    Hi NickyC
    Thanks for your quick response
    Is this a macro?
    Where do i add this?
    I have attached two sample excel books X1 & X2.
    Please help me how do i make it work?

    Regards

    Thomas
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,715

    Re: Compare cells and replace value

    Hi
    yes it is a macro

    To copy and use a macro:
    • press alt+F11 to open the VBA area
    • select insert > module
    • copy the code from this website and paste it into the VBA module you just inserted

    Return to the spreadsheet. On the developer tab, select macros and click the name of the macro you want to run

    If you cannot see the developer tab
    • Click the File tab
    • Click Options
    • Click Customize Ribbon
    • Under Customize the Ribbon and under Main Tabs, select the Developer check box

+ 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] Need to compare 3 cells and replace 1
    By jewelr in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-03-2014, 10:28 PM
  2. [SOLVED] Compare and Replace
    By maddog9486 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-14-2014, 05:48 PM
  3. Compare and replace with corresponding
    By Hellkeeper in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-03-2012, 01:25 PM
  4. Compare and replace
    By lavofra in forum Excel General
    Replies: 9
    Last Post: 03-06-2012, 06:33 AM
  5. Compare and replace
    By dimitriz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2009, 07:43 AM
  6. compare values and replace
    By Stephen in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-15-2006, 04:10 PM
  7. Q: compare and replace in a workbook
    By Arnfinn Hakkebo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-13-2005, 08:06 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