Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I've a cell assuming different values. For example:
105,32 euro
Now, with regex I've removed the non numeric value in order to have
105,32
My code:
Dim replacement As Object, trunc As String
Set replacement = CreateObject("vbscript.regexp")
With replacement
.Pattern = "[^0-9.,]+"
.Global = True
.IgnoreCase = True
End With
result = replacement.Replace(trunc, "")
The problem is: the result has some hidden "" on the edges like
"105,32"
I've a cell assuming different values. For example:
105,32 euro
Now, with regex I've removed the non numeric value in order to have
105,32
My code:
Dim replacement As Object, trunc As String
Set replacement = CreateObject("vbscript.regexp")
With replacement
.Pattern = "[^0-9.,]+"
.Global = True
.IgnoreCase = True
End With
result = replacement.Replace(trunc, "")
The problem is: the result has some hidden "" on the edges like
"105,32"
Last edited: