ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Comparing data in cells on 2 sheets (https://www.excelbanter.com/excel-discussion-misc-queries/15807-comparing-data-cells-2-sheets.html)

mayjay

Comparing data in cells on 2 sheets
 
I am trying to find a way to compare values in a specific cell on 2 sheets,
and if they are different values replace the value in the cell on sheet 1
with the value in the cell from sheet 2.

Nick Hodge

MayJay

To actually replace a value in a cell would require code as you could not
use a function to replace a referenced value. What you could do is use an IF
function in another columns which could then replace the old data, so if you
are comparing say A1 on Sheet1 with A1 on Sheet2 you could use

=IF(A1=Sheet2!A1,A1,Sheet2!A1)

You could then copy this down Column A and anywhere where the data did not
agree you would have the value from Sheet2. This could then be copied and
Editpaste special...+Values over the original data

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"mayjay" wrote in message
...
I am trying to find a way to compare values in a specific cell on 2 sheets,
and if they are different values replace the value in the cell on sheet 1
with the value in the cell from sheet 2.





All times are GMT +1. The time now is 08:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com