
05-11-2014, 11:53 PM
|
Advanced Beginner
|
|
Join Date: Mar 2011
Posts: 89
|
|
Quote:
Originally Posted by macropod
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
|