InternationalComma

Convert an international numeric with , instead of .
Into American style .
converts if only found it in a number, does not convert it inside text

Function InternationalComma(Valu, Optional ReplaceWith = ".")
'
Rett = Valu
Found1 = InStr(1, Valu, ",")
If Found1 = 0 Then GoTo ByeBye
Part1 = Left(Valu, Found1 - 1)
Part2 = Mid(Valu, Found1 + 1)
If Not IsNumeric(Part1) Then GoTo ByeBye
If Not IsNumeric(Part2) Then GoTo ByeBye
Rett = Val(Part1 & ReplaceWith & Part2)
ByeBye:
InternationalComma = Rett
End Function

Valu, Optional ReplaceWith

Views 687 Downloads 313

'Convert', 'replace', 'numeric', 'numbers', 'comma', 'dot', 'change', 'substitute'

ANmarAmdeen
333
Math VBA-Excel
Revisions

v1.0