Hi Anand,
See following logic and implement as per your requiremenet.
Set objExcel = CreateObject(”Excel.Application”)
objExcel.Visible = True
Set objWorkbook1= objExcel.Workbooks.Open(”C:\Docs1.xls”)
Set objWorkbook2= objExcel.Workbooks.Open(”C:\Docs2.xls”)
Set objWorksheet1= objWorkbook1.Worksheets(1)
Set objWorksheet2= objWorkbook2.Worksheets(1)
For Each cell In objWorksheet1.UsedRange
If cell.Value <> objWorksheet2.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
by Author: Mohan Kumar Kakarla
With Regards
Srinivas P
On Wed, Apr 1, 2009 at 11:18 PM, Roman Zilber <[email protected]> wrote:
> http://snipplr.com/view/2397/save-excel-file-as-csv/
>
>
> On Wed, Apr 1, 2009 at 1:18 PM, anand paradkar
> <[email protected]>wrote:
>
>> Dear All,
>>
>> Can any one help to compare 2 different excel sheets. And if any
>> difference take place how to report tht.
>>
>> Can any one explain me briefly (with code).
>>
>> Regards,
>> anand
>>
>>
>>
>
> >
>
--
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
-~----------~----~----~----~------~----~------~--~---