Find out values difference between 2 excel sheet
Closed
FirstLog
TrowaD
- Posts
- 2
- Registration date
- Wednesday June 14, 2017
- Status
- Member
- Last seen
- June 19, 2017
TrowaD
- Posts
- 2888
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- August 16, 2022
Related:
- Find out values difference between 2 excel sheet
- Compare 2 excel sheets - Guide
- Macro to compare two excel sheets ✓ - Forum - Excel
- How to compare two excel sheets for differences in values ✓ - Forum - Excel
- Vba code to compare two excel sheets and copy differences ✓ - Forum - Excel
- Compare two excel sheets and highlight differences macro ✓ - Forum - Excel
1 reply
TrowaD
Jun 19, 2017 at 11:12 AM
- Posts
- 2888
- Registration date
- Sunday September 12, 2010
- Status
- Moderator
- Last seen
- August 16, 2022
Jun 19, 2017 at 11:12 AM
Hi Firstlog,
So you have 2 sheets both with the same headers (6 in total) where column A contains unique value.
The code below loops through all the rows in the Manual sheet. It will look for the unique value in column A of the Software sheet. Once found, it will check if all the 5 subsequent columns contain the same data. If not, then the cells in the Manual sheet will be colored red.
Hopefully this is what you are after.
Here is the code:
So you have 2 sheets both with the same headers (6 in total) where column A contains unique value.
The code below loops through all the rows in the Manual sheet. It will look for the unique value in column A of the Software sheet. Once found, it will check if all the 5 subsequent columns contain the same data. If not, then the cells in the Manual sheet will be colored red.
Hopefully this is what you are after.
Here is the code:
Sub RunMe() Dim mFind As Range Sheets("Manual").Select For Each cell In Range("A2:A" & Range("A2").End(xlDown).Row) Set mFind = Sheets("Software").Columns("A").Find(cell.Value) If Not mFind Is Nothing Then If mFind.Offset(0, 1) <> cell.Offset(0, 1) Or _ mFind.Offset(0, 2) <> cell.Offset(0, 2) Or _ mFind.Offset(0, 3) <> cell.Offset(0, 3) Or _ mFind.Offset(0, 4) <> cell.Offset(0, 4) Or _ mFind.Offset(0, 5) <> cell.Offset(0, 5) Then Range(Cells(cell.Row, "A"), Cells(cell.Row, "F")).Interior.ColorIndex=3 End If End If Next cell End Sub