T
Tim H
Hello,
I have 2 sets of data and need to see if the SSN from the first sheet is
existant in the other and if so Copy that cell and paste it in a third sheet.
first 9 Characters in first sheet are SSN, Characters 7-15 are the SSN on
second sheet.
Sheets("Compiled").Select
Range("A1").Select
For i = 1 To 1500
Sheets("Compiled").Select
Keyy = Cells(i, 1).Value
Keyy2 = Mid(Keyy, 1, 9)
Typ = Cells(i, 2).Value
If Keyy = "" Then
EmptyRowCounter = EmptyRowCounter + 1
GoTo Skip
Else
EmptyRowCounter = 0
Sheets("Compare").Select
Range("A1").Select
For z = 1 To 2500
SSN = Cells(i, 1).Value
SSN2 = Mid(SSN, 7, 9)
If SSN2 = Keyy2 Then
Message = SSN
Sheets("OUTPUT").Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Cells(1, 1).Value = Message
End If
Next
End If
Skip:
If EmptyRowCounter = 20 Then GoTo Endd
Next
Endd:
Sheets("Compiled").Select
Range("A1").Select
End Sub
Sample Data
1st list SSN = 1-9: "123456789200701012315446"
2nd list SSN = 7-15: " 123456789200712122556000000.0000022554.35.000000"
Any help would be greatly appreciated
All The Best,
Tim
I have 2 sets of data and need to see if the SSN from the first sheet is
existant in the other and if so Copy that cell and paste it in a third sheet.
first 9 Characters in first sheet are SSN, Characters 7-15 are the SSN on
second sheet.
Sheets("Compiled").Select
Range("A1").Select
For i = 1 To 1500
Sheets("Compiled").Select
Keyy = Cells(i, 1).Value
Keyy2 = Mid(Keyy, 1, 9)
Typ = Cells(i, 2).Value
If Keyy = "" Then
EmptyRowCounter = EmptyRowCounter + 1
GoTo Skip
Else
EmptyRowCounter = 0
Sheets("Compare").Select
Range("A1").Select
For z = 1 To 2500
SSN = Cells(i, 1).Value
SSN2 = Mid(SSN, 7, 9)
If SSN2 = Keyy2 Then
Message = SSN
Sheets("OUTPUT").Select
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Cells(1, 1).Value = Message
End If
Next
End If
Skip:
If EmptyRowCounter = 20 Then GoTo Endd
Next
Endd:
Sheets("Compiled").Select
Range("A1").Select
End Sub
Sample Data
1st list SSN = 1-9: "123456789200701012315446"
2nd list SSN = 7-15: " 123456789200712122556000000.0000022554.35.000000"
Any help would be greatly appreciated
All The Best,
Tim