AW: erklär mal bitte genauer ...
02.01.2013 00:31:04
fcs
Hallo Alifa,
den Sinn sollcher Ziffernfolgen verstehe ich zwar nicht, aber nachfolgende benutzerdefinierte Funktion sollte das entsprechende Prüfergebnis liefern.
Gruß
Franz
Function TestString(strTest, Optional strFuell As String = "0") As Boolean
Dim intAnzZahlen, Zahl1, Zahl2, intAnzFuell As Integer
Dim intPos As Integer
TestString = True
If Not IsNumeric(strTest) Then TestString = False: Exit Function
For intPos = 1 To Len(strTest)
If Mid(strTest, intPos, 1) = strFuell Then
intAnzFuell = intAnzFuell + 1
Else
intAnzZahlen = intAnzZahlen + 1
If intAnzZahlen > 3 Then TestString = False: Exit Function
If Zahl1 = 0 Then
Zahl1 = CLng(Mid(strTest, intPos, 1))
intAnzFuell = 0
Else
Zahl2 = CLng(Mid(strTest, intPos, 1))
If Abs(Zahl2 - Zahl1) - 1 intAnzFuell Then
TestString = False
Exit For
End If
Zahl1 = Zahl2
intAnzFuell = 0
End If
End If
Next
If intAnzZahlen