View Single Post
  #4   Report Post  
David McRitchie
 
Posts: n/a
Default

Hi Mike,

Assuming you can have commas which will be ignored and that
the dollar amounts must have exactly two decimals and that you
have no negative numbers.

Function getdollars(cell As String) As Double
Dim Str As String, i As Long, dswt As Integer
For i = 1 To Len(cell)
Select Case Mid(cell, i, 1)
Case "."
dswt = 1
Str = Str & Mid(cell, i, 1)
Case ","
Case "0" To "9"
Str = Str & Mid(cell, i, 1)
If dswt Then dswt = dswt + 1
Case Else
If dswt = 3 Then getdollars = getdollars + Str
Str = ""
dswt = 0
End Select
Next i
If dswt = 3 Then getdollars = getdollars + Str
End Function

B5: '984 163.94 981 7.84
C5: =getdollars(b5)

If not familiar with User Defined Functions you will find instructions
to install UDF and macros in
http://www.mvps.org/dmcritchie/excel/getstarted.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"mikeburg" wrote in message
...

Biff:

No, the quotes are not part of the cell's contents.

Yes, the cell can contain one or two dollar amounts to be pulled &
totaled for that cell.

Any help you can give will be greatly appreciated!

mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=388562