Sum all integers of a given number
Cross posting is okay, multi-posting is irritating.
" wrote:
On 8 Jun, 15:41, pchr wrote:
Hi,
Is there an easy way to arrange a formula that will Sum all integers
of a given number?
Cross posting is a no-no, but on the assumption you may still be
waiting for an answer, here is one way to do it.
Sub sumNumbers()
Dim checkRow As Long
Dim instrPosition As Integer
Dim summedTotal As Long
checkRow = 1
Do
summedTotal = 0
For instrPosition = 1 To Len(Range("a" & checkRow).Value)
summedTotal = summedTotal + _
Mid(Range("a" & checkRow).Value, instrPosition, 1)
Next
Range("B" & checkRow).Value = summedTotal
checkRow = checkRow + 1
Loop Until Range("a" & checkRow).Value = ""
End Sub
--
juux
|