Private Sub Command1_Click()
Dim repeat As Boolean
On Error Resume Next
Dim tmp As String
Dim filepath As String
cmdg.ShowOpen
filepath = cmdg.FileName
Open filepath For Input As #1
tmp = Input(LOF(1), #1)
Close #1
Text1.Text = tmp
Dim x() As String
x = Split(Text1.Text, vbCrLf)
Dim y(100) As String
For i = 0 To UBound(x)
x(i) = Mid(x(i), 1, 6)
Next
For i = 0 To UBound(x)
Counter = 0
For j = i + 1 To UBound(x)
If x(i) <> x(j) And Mid(x(i), 1, 5) = Mid(x(j), 1, 5) Then
Counter = Counter + 1
If Counter = 9 Then
Text2.Text = Text2.Text & vbCrLf & Mid(x(i), 1, 5) & " 5-5"
k = k + 1
y(k) = Mid(x(i), 1, 5)
Counter = 0
i = i + 1
Exit For
End If
End If
Next
repeat = False
For p = 1 To UBound(x)
If y(p) = Mid(x(i), 1, 5) Then
p = p + 1
repeat = True
Exit For
End If
Next
If Not repeat Then Text2.Text = Text2.Text & vbCrLf & x(i) & " 5-5"
Next
End Sub