Comparison between two excel sheet
Solved/Closed
Related:
- Comparison between two excel sheet
- Mark sheet in excel - Guide
- How to open excel sheet in notepad++ - Guide
- Windows network commands cheat sheet - Guide
- Google sheet right to left - 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.