Public Function hasConsecutive(ByVal strText As String, Optional ByVal intLenToTest As Integer = 4) As Boolean
Dim i As Integer, cnt1 As Integer, cnt2 As Integer
Dim ln As Integer, a As Integer, b As Integer, c As Integer
ln = Len(strText)
For i = 1 To ln
If cnt1 = 0 Then
cnt1 = 1: cnt2 = 1
Else
'first part, check for consecutive (up)
'second part, repeating
a = Asc(Mid$(strText, i - 1))
b = Asc(Mid$(strText, i - 1)) + 1
c = Asc(Mid$(strText, i, 1))
If b = c Then
cnt1 = cnt1 + 1
Else
cnt1 = 1
End If
If a = c Then
cnt2 = cnt2 + 1
Else
cnt2 = 1
End If
End If
Next
hasConsecutive = (cnt1 > intLenToTest - 1) Or (cnt1 = ln) Or (cnt2 > intLenToTest - 1) Or (cnt2 = ln)
End Function