Hi folks,
I need help for Extracting dollar amounts from cell.
I have done one code but that code extract only 4 digit values !
For example $5000 if my excel have $15000 it track only $15! can any one say where I miss?
Here is my code FYI......
Code
Sub spliter()
'Call Command
Dim r As Range, i As Long, m As Object
Application.DisplayAlerts = False
With CreateObject("VBScript.Regexp")
.Global = True
.IgnoreCase = True
.Pattern = "(\$\d+\d+)|(\$(\d+(\,\d+)?))|(\b\d+\d+\%)"
For Each r In Range("C1", Range("C" & Rows.Count).End(xlUp))
If .test(r.Value) Then
Set m = .Execute(r.Value)
For i = 0 To m.Count - 1
r(, 2 + i).Value = m(i)
Next
End If
Next
End With
Application.DisplayAlerts = True
End Sub
Display More
Thanks & Regards,
dev