08-13-2009, 10:40 AM
Hi,
Try with the below code u would get expected result....
----------------------
------------------------
Try with the below code u would get expected result....
----------------------
Code:
Set objExcel = CreateObject(”Excel.Application”)
objExcel.Visible = True
Set Wk1= objExcel.Workbooks.Open("File path1")
Set Wk2= objExcel.Workbooks.Open("Filepath2")
Set Ws1= Wk1.Worksheets(1)
Set Ws2= Wk2.Worksheets(1)
For Each cell In Ws1.UsedRange
If cell.Value <> Ws2.Range(cell.Address).Value Then
cell.Interior.ColorIndex = 3′Highlights in red color if any changes in cells
Else
cell.Interior.ColorIndex = 0
End If
Next
set objExcel=nothing