Excel VBA Macro - parse data

K

kb42

Hello
I need help on very simple Excel question.
I have excel file exported from quickbooks which has buying cos
column: Here is some sample data

$0.04
$1.50
$1.135
$0.445*04
$0.01*EX
$0.02(some text)
$0.063 ES

I want to get only cost ( means I want to delete the strings after
"*", "(" , or space ).

Thank you in advance for your help!!!

Jaso
 
M

MSP77079

I pasted the examples you gave into cells C5:C11

Sub test()

For i = 5 To 11
myText = Cells(i, "C")
myLen = Len(myText)
For n = 1 To myLen
If IsNumeric(Left(myText, n)) Then thisNum = Left(myText
n)
Next n
Cells(i, "F") = Format(thisNum, "$ #.00")
Next i


End Su
 
Top