Is this possible? comparing two sheets

mcintoshmc

Active Member
Joined
Aug 10, 2007
Messages
277
Sheet 1 is a roster of all employees. I added a new column (T) at the end of the roster and put the date the roster was run.
Sheet 2 is the exact same as sheet 1, but it will be a new roster.

For example, sheet 1 will contain 4/18 and sheet 2 will contain 4/19 in column T.

Column A is the identifier. I would like to create a third sheet, that will identify the Unique values between both sheets from Column A, and provide the corresponding date from column T.

So, new hire employee ID from column A will show "12345" with a date of 4/19 from column T. Is this possible?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
How about
Code:
Sub IdUnique()

   Dim Cl As Range
   Dim ws1 As Worksheet
   Dim ws2 As Worksheet
   
   Set ws1 = Sheets("Pcode")
   Set ws2 = Sheets("Sheet2")
   
   With CreateObject("scripting.dictionary")
      For Each Cl In ws1.Range("A2", ws1.Range("A" & Rows.Count).End(xlUp))
         If Not .exists(Cl.Value) Then .Add Cl.Value, Cl.Offset(, 19).Value
      Next Cl
       For Each Cl In ws2.Range("A2", ws2.Range("A" & Rows.Count).End(xlUp))
         If Not .exists(Cl.Value) Then
            .Add Cl.Value, Cl.Offset(, 19).Value
         Else
            .Remove Cl.Value
         End If
      Next Cl
      Sheets("Sheet3").Range("A1").Resize(.Count).Value = Application.Transpose(.keys)
      Sheets("Sheet3").Range("B1").Resize(.Count).Value = Application.Transpose(.items)
   End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,249
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top