ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Comparing 2 worksheets in Excel 2007 (https://www.excelbanter.com/excel-worksheet-functions/249655-comparing-2-worksheets-excel-2007-a.html)

Sue

Comparing 2 worksheets in Excel 2007
 
I am trying to compare 2 worksheets in a large workbook. One sheet is named
1st Proposed HMIs. The other is named 2nd Proposed HMIs. Both spreadsheets
are exactly the same. I would like to compare the 2nd sheet with the 1st
sheet and have Excel highlight or shade any cell that has changed or
different data in the 2nd sheet. Any ideas? Thanks!

ryguy7272

Comparing 2 worksheets in Excel 2007
 
Try this:
http://www.softinterface.com/MD/Docu...n-Software.htm

Or, this code:
Sub Compare2Shts()
For Each Cell In Worksheets("CompareSheet#1").UsedRange
If Cell.Value < Worksheets("CompareSheet#2").Range(Cell.Address) Then
Cell.Interior.ColorIndex = 3
End If
Next

For Each Cell In Worksheets("CompareSheet#2").UsedRange
If Cell.Value < Worksheets("CompareSheet#1").Range(Cell.Address) Then
Cell.Interior.ColorIndex = 3
End If
Next
End Sub


Sub CompareAnother2Shts()
For Each Cell In Worksheets("CompareSheet#1").Range("A1:J50")
If Cell.Value < Worksheets("CompareSheet#2").Range(Cell.Address) Then
Cell.Interior.ColorIndex = 3
End If
Next

For Each Cell In Worksheets("CompareSheet#2").Range("A1:J50")
If Cell.Value < Worksheets("CompareSheet#1").Range(Cell.Address) Then
Cell.Interior.ColorIndex = 3
End If
Next
End Sub
'...change the range to suit your needs.

HTH,
Ryan

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Sue" wrote:

I am trying to compare 2 worksheets in a large workbook. One sheet is named
1st Proposed HMIs. The other is named 2nd Proposed HMIs. Both spreadsheets
are exactly the same. I would like to compare the 2nd sheet with the 1st
sheet and have Excel highlight or shade any cell that has changed or
different data in the 2nd sheet. Any ideas? Thanks!



All times are GMT +1. The time now is 01:27 PM.

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