Function Numerology(Number As Variant) 'Written by Barrie Davidson Dim Length As Double Dim Holder As Double Application.Volatile On Error Resume Next If IsNumeric(Number) = False Then Numerology = "N/A" Exit Function ElseIf Number = "" Then Numerology = "N/A" Exit Function Else Evaluation: Length = Len(CStr(Number)) Holder = 0 For i = 1 To Length Holder = Holder + CDbl(Mid(CStr(Number), i, 1)) Next i If Len(CStr(Holder)) > 1 Then Number = Holder GoTo Evaluation End If End If Numerology = Holder End FunctionAfter you have pasted the code, you can close the visual basic editor window (this doesn't take you out of Excel). To access this custom function, (from the top menu in Excel), select Insert|Function. The Paste Function menu box will pop up. Select User Defined in the left window and then select the function you created from the right window.
Copyright ©
2001 by Barrie R. Davidson
Added September, 2002