Help in mergin two excel sheet and finding the difference.

Hello All,
Working on an excel problem any help would be appreciated. I have two excel workbooks. WorkbookA and WorkbookB both of them have one spreadsheet with similar data. 1st requirement is to merge them group by patient ID and Event Name  and 2nd requirement is to find the difference if its there in each cell and highlight it. Please find the attachment for additional information.  I have them all in one excel workbook.

Thanks in advance.
Template1.xlsx
Milind AgarwalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Milind AgarwalAuthor Commented:
Some logic in comparison part
   
    Dim varSheetA As Variant
    Dim varSheetB As Variant
    Dim strRangeToCheck As String
    Dim iRow As Long
    Dim iCol As Long

 For iRow = LBound(varSheetA, 1) To UBound(varSheetA, 1)
        For iCol = LBound(varSheetA, 2) To UBound(varSheetA, 2)
            If varSheetA(iRow, iCol) = varSheetB(iRow, iCol) Then
            Else
             End If
        Next iCol
    Next iRow

End Sub
0
Robberbaron (robr)Commented:
1. how do you want the merged worksheet to look ?  just join them all together ?

2. you indicated this is the first priority but then want to do a comparison ?  Is character case of concern ?

3. perhaps you mean..
   a. merge worksheets
   b. sort by PatientID, EventName , OnsetDate
   c. hightlight adjacent rows where the above sort items are the same ?
0
Milind AgarwalAuthor Commented:
Hey,
The merged worksheet should look like the template sheet3 that I have in attachment. Considering Sheet1 as one workbook and sheet2 is another one. Sheet3 represents the merged one. I can do this easily in SQL but Macro isnt my area of expertise. Thanks
0
Robberbaron (robr)Commented:
trial attached, along with my test sources.
MergedData.xlsm
DB1.xlsx
DB2.xlsx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.