View Single Post
 
Old 05-11-2014, 11:53 PM
shabbaranks shabbaranks is offline Windows 7 64bit Office 2007
Advanced Beginner
 
Join Date: Mar 2011
Posts: 89
shabbaranks is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
You could use a UDF for this:
Code:
Public Function SUMCELLNUMS(Source As Range, StrSplit As String)
Dim StrIn As String, StrTmp As String, ValOut, i As Long
StrIn = Trim(Replace(Source.Text, "'", ""))
For i = 0 To UBound(Split(StrIn, StrSplit))
  StrTmp = Trim(Split(StrIn, StrSplit)(i))
  If IsNumeric(StrTmp) Then
    ValOut = Evaluate(ValOut + StrTmp)
  End If
Next
SUMCELLNUMS = ValOut
End Function
Simply add the above function to a normal code module in the workbook, then use a formula like:
=SUMCELLNUMS(A1, ",")
where A1 is the cell reference and "," is the delimiter.
Perfecto!! Thanks
Reply With Quote