
Originally Posted by
mstubbs
What about if your numbers are formatted in tenths and have ( ) around them? Such as:
ASDF(2.5); ASDF (3.6); ASDF (5.8)
Any way to get it to get you the total of the numbers in the same cell in the same format and only the numbers in between the ( )?
Assuming there are no "."s (dots) in the string, other than the decimal points.
Change the function to this ...
Function SumCell(rng As Range)
Dim strtmp As String
Dim n As Long
For n = 1 To Len(rng)
If Asc(Mid(rng, n, 1)) >= 48 And Asc(Mid(rng, n, 1)) <= 57 Or Asc(Mid(rng, n, 1)) = 46 Then
strtmp = strtmp & Mid(rng, n, 1)
Else
strtmp = strtmp & " "
End If
Next
strtmp = WorksheetFunction.Trim(strtmp)
SumCell = Evaluate(Replace(strtmp, " ", "+"))
End Function
Bookmarks