How can i compare two excel sheets using VBA

Closed
Rajesh - Jun 14, 2011 at 05:56 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jun 14, 2011 at 05:25 PM
Hello,
I am having two text files ( which is a comma separated file).The template of the two file is given below.

SD,CurrentDate,RecordCount
NI,FirstName,LastName,Place,Language
EQ,Degree,University,Year,Aggregate
ED,CurrentDate,RecordCount




The Data in the first file - one.txt



SD,13/06/2010,6
NI,Rajesh,kumar,xxxx,english
EQ,X,Stateboard,2004,75
EQ,XII,Stateboard,2006,85
EQ,B.E,Oxford,2008,79
ED,13/06/2010,6



The Data in the Second file - Second.txt


SD,13/06/2010,6
NI,Rajesh,kumar,,english
EQ,X,,2004,75
EQ,XII,Stateboard,2006,
EQ,,Oxford,2008,79
ED,13/06/2010,6


Now I have populted the value of the one.txt to the "sheet1" of Excel sheet(Output.xls) and then i have populated the value of the Second.txt to the "sheet2" of Excel sheet(Output.xls) by using the .Net code.



Now i want to compare two sheets data and populte the difference in the "sheet3".

The o/p of the "Sheet3" will have.


Cell1 Cell2 Cell3 Cell4 Cell5
SD:True CurrentDate:True RecordCount:True
NI:True FirstName:True LastName:True Place:False Language:True
EQ:True Degree:True University:False Year:True Aggregate:True
EQ:True Degree:True University:True Year:True Aggregate:False
EQ:True Degree:False University:True Year:True Aggregate:True
SD:True CurrentDate:True RecordCount:True



How can i compare this two sheets? Is it possible through VBA? Please anyone provide me the solution?


Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 14, 2011 at 05:25 PM
Could you post a sample book at some shared site and post back the link to the file back here
0