Comparison between two excel sheet
Solved/Closed
Hello,
i have two excel sheet with same value which i need to compare every day .with in same excel sheet i can compare easyly using conditional formating but in case of comparison between two excel sheet conditional formating is not working so i just want to know vba code which compare the value sheet 1 a1 and with sheet2 a1 and if it's doesn't match then the value which is in sheet 1 a1 should show in red color .
i have two excel sheet with same value which i need to compare every day .with in same excel sheet i can compare easyly using conditional formating but in case of comparison between two excel sheet conditional formating is not working so i just want to know vba code which compare the value sheet 1 a1 and with sheet2 a1 and if it's doesn't match then the value which is in sheet 1 a1 should show in red color .
Related:
- Comparison between two excel sheet
- Mark sheet in excel - Guide
- How to open excel sheet in notepad++ - Guide
- Sheet right to left in google sheet - Guide
- Windows network commands cheat sheet - Guide
- How to screenshot excel sheet - Guide
2 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Nov 3, 2009 at 10:19 PM
Nov 3, 2009 at 10:19 PM
I have given a macro below
when do you want this macro to be invoked( under what event ) or do you want to invoke th macro periodically
the macro is
Please rememner that only if A1 or any other cells in column A of sheet 1 is same as the entry in the same address in shseet2 that cell in sheet 1 will be red. suppose the same entry in any cell in sheet1 is found in some other address in sheet 2 the original cell in sheet 1 wil Not be red.
when do you want this macro to be invoked( under what event ) or do you want to invoke th macro periodically
the macro is
Sub test() Dim r As Range, c As Range, j As Integer, k As Integer With Worksheets("sheet1") Set r = Range(.Range("A1"), .Range("A1").End(xlDown)) r.Cells.Interior.ColorIndex = xlNone For Each c In r j = c.Row k = c.Column If c = Worksheets("sheet2").Cells(j, k) Then c.Interior.ColorIndex = 3 End If Next c End With End Sub
Please rememner that only if A1 or any other cells in column A of sheet 1 is same as the entry in the same address in shseet2 that cell in sheet 1 will be red. suppose the same entry in any cell in sheet1 is found in some other address in sheet 2 the original cell in sheet 1 wil Not be red.