I have 2 data tables with three columns empname, empid and role 
want to compare both table by column "role" to check whether common employee in both sheets as different role or not .

i want to flag exception role wise( i.e common employee of both tables have different roles)
e.g of data tables

table 1

```
EmpName        EmpID        Role
Aakash C Shah   id1        user, auditor
Abdul Yasin     id2        Password Admin,Password Admin,Group Admin
Abhijit Chakre  id3        Group Admin,Password Admin
Abhijit Dixit   id4        Group Admin,DC Admin

```

table 2

```
Emp Name        EmpID        Role
Aakash C Shah   id1      auditor,password Admin, DC Admin
Abdul Yasin     id2      Group Admin,Password Admin,Password Admin
Abhijit Chakre  id3      Password Admin,Group Admin
Abhijit Dixit   id5      DC Admin,Group Admin

```

i m facing below issue
1) exact match of string is not happening for "role" column as we can see employee with empID id 2 and id 3 are same but still exceptions are coming since sequence of role in the cell is different .i.e
in table 1 it starts with password admin and in table 2 it starts with group admin
similar is the case with id 3.it should come not as exception .

exception should be emp - Aakash C Shah with id1 as it has different role in both sheets .
My approach was

1. split the string into array
2. sorting of array
3. concatenation of string- newcolumn (say 4)
4. output should come when table1(col 4) <> table 2(col4) for same employee.

but i was doing through macro recording.Can anyone help with vba code at least for 1 and 2 point .

```
<Option Explicit

Sub compare()

Dim shtold As Worksheet, shtnew As Worksheet, shtmatch As Worksheet
Dim oldrow As Long
Dim newrow As Integer
Dim I As Integer, id, f As Range

Application.Cursor = xlDefault

          I = 2

Set shtold = ThisWorkbook.Sheets("sheet1")
Set shtnew = ThisWorkbook.Sheets("sheet2")
Set shtmatch = ThisWorkbook.Sheets("sheet3")

Application.ScreenUpdating = False

     For oldrow = 2 To 10

    id = Trim(shtold.Cells(oldrow, 5))

    Set f = shtnew.Range("E2:E5").Find(id)

    If f Is Nothing Then

    With shtmatch.Rows(I)
        .Cells(1).Value = shtold.Cells(oldrow, 1)
        .Cells(2).Value = id
        .Cells(3).Value = shtold.Cells(oldrow, 2)

    End With

    I = I + 1
    End If
  Next oldrow

Application.ScreenUpdating = True
MsgBox "Finished", vbInformation, "Done!"

  End Sub>

```

* Inputs

sheet1

```
EmpName        EmpID       Role3
Aakash C Shah   id1       id1auditoruser
Abdul Yasin     id2       id2group adminpassword adminpassword admin
Abhijit Chakre  id3       id3group adminpassword admin
Abhijit Dixit   id4       id4dc admingroup admin

```

sheet2

```
EmpName         EmpID   role3
Aakash C Shah   id1     id1auditordc adminpassword admin
Abdul Yasin     id2     id2group adminpassword adminpassword admin
Abhijit Chakre  id3     id3group adminpassword admin
Abhijit Dixit   id5     id5dc admingroup admin

```

output( expected) -

```
EmpName           EmpID       Role3
 Aakash C Shah    id1         id1auditoruser

```

AS it is different from sheet2