'The function below goes on adding the numbers in a string untill it
'becomes a single number between 0 and 9,e.g., 1234=1+2+3+4=10=1
Private Function ReX(ByVal AnyStr As String) As String
Dim n As Integer, i As Integer
For i = 1 To Len(AnyStr)
n = n + Val(Mid(AnyStr, i, 1))
Next
If Len(Str(n)) > 2 Then n = Val(ReX(Str(n)))
ReX = Right(Str(n), 1)
End Function
|