If you are interested in having the output as a comma delimited string within a single cell, like 'snb' assumed you wanted, as opposed to the multi-cell output of my original UDF, you could use the following UDF (note I used the same function name, so you would have to comment out or delete my previous UDF from your module before running this one)...
Note... unlike my previous UDF, this one can be placed anywhere (that is, it does not have to be placed next to the cell it is processing). Also, the calling formula would be the same....Code:Function InvoiceNumbers(S As String) As String
Dim X As Long, OutText As String
For X = 1 To Len(S)
If Mid(S, X, 11) Like "[A-Za-z][A-Za-z][A-Za-z]#####/##" Then
OutText = OutText & ", " & Mid(S, X, 11)
ElseIf Mid(S, X, 10) Like "2000######" Or Mid(S, X, 10) Like "1800######" Then
OutText = OutText & ", " & Mid(S, X, 10)
End If
Next
If Len(S) Then InvoiceNumbers = Mid(OutText, 3)
End Function
=InvoiceNumbers(A1)