Good evening the-charles
This function will add up all the numbers in a cell, provided it is applied to a numeric cell. Once pasted into your VBE use it like you would a formula, thus:
=Adder(A1) will perform the operation on cell A1.
Function Adder(InThis)
d = 0
a = Len(InThis)
For b = 1 To a
c = Mid(InThis, b, 1)
d = d + c
Next b
Adder = d
End Function
HTH
DominicB
|