QTP Forum


Join the forum, it's quick and easy

QTP Forum
QTP Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Poll
Keywords

Latest topics
» composite primary key
How to Compare two Excel sheets cell by cell EmptyThu Jun 19, 2014 11:31 am by thomasdfg

» How to identify the object when it is dynamically changing behavior
How to Compare two Excel sheets cell by cell EmptyWed Jun 18, 2014 6:37 pm by thomasdfg

» Patches for QTP 10, 11, 11.5
How to Compare two Excel sheets cell by cell EmptyWed Jun 18, 2014 6:04 pm by thomasdfg

» Retrieving data from Txt file into datatable
How to Compare two Excel sheets cell by cell EmptyWed Jun 18, 2014 5:32 pm by thomasdfg

» VB Script to count number of links in a web page.
How to Compare two Excel sheets cell by cell EmptyWed Jun 18, 2014 4:51 pm by thomasdfg

» Customized HTML reports in QTP
How to Compare two Excel sheets cell by cell EmptyWed Jun 18, 2014 4:42 pm by thomasdfg

» how to print values into a field of a web page, from a data table in qtp?
How to Compare two Excel sheets cell by cell EmptyWed Jun 18, 2014 4:37 pm by thomasdfg

» How to delete cookies using QTP?
How to Compare two Excel sheets cell by cell EmptyWed Jun 18, 2014 4:30 pm by thomasdfg

» When UFT Does Not Identify an Object
How to Compare two Excel sheets cell by cell EmptyWed Jun 18, 2014 4:23 pm by thomasdfg

April 2024
MonTueWedThuFriSatSun
1234567
891011121314
15161718192021
22232425262728
2930     

Calendar Calendar

Affiliates
free forum


How to Compare two Excel sheets cell by cell

Go down

Vote if this topic was useful to you

How to Compare two Excel sheets cell by cell Vote_lcap0%How to Compare two Excel sheets cell by cell Vote_rcap 0% 
[ 0 ]
How to Compare two Excel sheets cell by cell Vote_lcap0%How to Compare two Excel sheets cell by cell Vote_rcap 0% 
[ 0 ]
How to Compare two Excel sheets cell by cell Vote_lcap100%How to Compare two Excel sheets cell by cell Vote_rcap 100% 
[ 1 ]
How to Compare two Excel sheets cell by cell Vote_lcap0%How to Compare two Excel sheets cell by cell Vote_rcap 0% 
[ 0 ]
 
Total Votes : 1
 
 

How to Compare two Excel sheets cell by cell Empty How to Compare two Excel sheets cell by cell

Post by Gajre Wed Jul 04, 2012 3:19 am

''This code will open two excel sheet and compare each sheet cell by cell, if any changes there in cells , it will highlight the cells in red color in the first sheet.

Set objExcel = CreateObject(“Excel.Application”)
objExcel.Visible = True
Set objWorkbook1= objExcel.Workbooks.Open(“C:\Users\sgajre\Desktop\ListOfTopics1.xls”)
Set objWorkbook2= objExcel.Workbooks.Open(“C:\Users\sgajre\Desktop\ListOfTopics2.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
'Highlights in red color if any changes in cells
cell.Interior.ColorIndex = 3
Else
cell.Interior.ColorIndex = 0
End If
Next
set objExcel=nothing
Gajre
Gajre
Admin

Posts : 37
Join date : 2012-06-17
Age : 41
Location : Hyderabad

https://qtpelearning.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum