Gruppe
UDF
Problem
Wie kann ich in Excel die Quersumme einer Zahl berechnen?
StandardModule: basMain
Function CheckSum(lValue As Long)
Dim iCounter As Integer, iSum As Integer
lValue = Fix(lValue)
For iCounter = 1 To Len(CStr(lValue))
iSum = CInt(iSum) + CInt(Mid(lValue, iCounter, 1))
Next iCounter
CheckSum = iSum
End Function