Re: summing numbers with in a cell




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


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=18932
View this thread: http://www.excelforum.com/showthread.php?threadid=384945

.



Relevant Pages

  • Re: Enter current time into cell hh:mm:ss
    ... with this is that it will alter every time the sheet is recalculated. ... The code below will call the NOWfunction, format the cell ... Sub TimeStamp() ... DominicB ...
    (microsoft.public.excel.programming)
  • Re: VBA - Passing Cell Contents Into Comment
    ... DominicB, ... Apparently the cell you insert ... ajocius's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=17695 ... Prev by Date: ...
    (microsoft.public.excel.programming)
  • Re: Creating new sheets
    ... You want bob in cell A1 of which sheet, ... Do you want bob in every single sheet? ... DominicB ...
    (microsoft.public.excel.misc)
  • Re: Using MsgBox in Formula
    ... No can do I'm afraid - Msgbox is VBA only. ... Your alternatives are conditional formatting, or having "blank" cell ... DominicB ...
    (microsoft.public.excel)
  • Re: consolidating workbooks
    ... thanks for the help dominicb. ... > highlight the range on your second source sheet, ... > what you want and it's quicker than doing it cell by cell. ...
    (microsoft.public.excel.worksheet.functions)