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
'
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 3,722
Downloads 1,416
CodeID
DB ID