If you want to know which cells are different, this is the only way...

but if you just want to know that if they are different then compare the
file sizes, if they are differ they will have different file sizes.

The best thing would be to to compare the file sizes first, then the
individual cells.



On Wed, Sep 11, 2013 at 2:40 PM, Mary <marythanga...@gmail.com> wrote:

> I need to compare two excel files (each file has 20 sheets).
> I used the below code. But it is taking more than 1 hour to complete.
> Please share if any other way to compare excels.
>
> Set objExcel = CreateObject(“Excel.Application”)
> objExcel.Visible = True
> Set objWorkbook1= objExcel.Workbooks.Open(“Docs1.xls”)
> Set objWorkbook2= objExcel.Workbooks.Open(“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
>
> --
> --
> 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 MercuryQTP@googlegroups.com
> To unsubscribe from this group, send email to
> mercuryqtp+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "QTP - HP Quick Test Professional - Automated Software Testing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mercuryqtp+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Regards

Arunabh Ray

-- 
-- 
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 MercuryQTP@googlegroups.com
To unsubscribe from this group, send email to
mercuryqtp+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

--- 
You received this message because you are subscribed to the Google Groups "QTP 
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mercuryqtp+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to