Slight variation to remove spaces before analysis.
Function GetSeven(Cell As Range) As Long
Dim N As Integer, M As Integer
Dim Possible As Boolean
MyString = Cell.Value
MyString = WorksheetFunction.Substitute(MyString, " ", "")
For N = 1 To Len(MyString) - 6
Possible = True
For M = N To N + 6
If IsNumeric(Mid(MyString, M, 1)) = False Then
Possible = False
Exit For
End If
Next M
If Possible = True Then
If InStr(N + 1, MyString, Mid(MyString, N, 7)) > 0 Then
GetSeven = Val(Mid(MyString, N, 7))
End If
End If
Next N
End Function
Bookmarks