Sub FindVals()
Dim _
lRow As Long, _
rngToCheck As Range, _
rCell As Range, _
strCell As String, _
aStrArray() As Variant, _
i As Integer, _
intFound As Integer
lRow = ActiveSheet.Cells(Rows.Count, 4).End(xlUp).Row
Set rngToCheck = ActiveSheet.Range("D1:D" & lRow)
For Each rCell In rngToCheck
ReDim aStrArray(0)
If Not InStr(1, rCell, 2, vbTextCompare) = 0 Then
strCell = rCell
intFound = InStr(1, strCell, 2, vbTextCompare)
Do While Not intFound = 0
If Len(Mid(strCell, intFound, 8)) = 8 Then
If Mid(strCell, intFound, 8) Like "2#######" _
And Not Mid(strCell, intFound, 9) Like "2########" Then
aStrArray(UBound(aStrArray())) = _
Mid(strCell, intFound, 8)
ReDim Preserve aStrArray(UBound(aStrArray()) + 1)
End If
strCell = Right(strCell, (Len(strCell) - 7) - intFound)
intFound = InStr(1, strCell, 2, vbTextCompare)
Else
Exit Do
End If
Loop
If Not UBound(aStrArray()) = 0 Then _
ReDim Preserve aStrArray(UBound(aStrArray()) - 1)
strCell = vbNullString
If Not aStrArray(0) = Empty Then
For i = LBound(aStrArray()) To UBound(aStrArray())
strCell = strCell & aStrArray(i) & ";"
Next
strCell = Left(strCell, Len(strCell) - 1)
rCell.Offset(, 1).Value = strCell
End If
End If
Next
End Sub