View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Eric Eric is offline
external usenet poster
 
Posts: 1,670
Default How to determine the number?

Thank everyone for any suggestions
Could you please tell me how to apply following codes?
Thanks you very much for any suggestions
Eric

"Don Guillett" wrote:

Try this
Sub addupnumberdigits()
ac = ActiveCell
mysum = 0
For i = 1 To Len(ac)
mysum = mysum + Mid(ac, i, 1)
Next i
MsgBox mysum
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Eric" wrote in message
...
Does anyone have any suggestions on how to determine the number?
For example, 2584 in cell A1, then it should return 2+5+8+4=19 in cell B1.
Does anyone have any suggestions?
Thanks in advance for any suggestions
Eric