1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Dim truc As String
truc = "1 000,55"
If IsNumeric(truc) Then MsgBox Val(truc), vbInformation, truc & " ="
truc = "1 000,55"
If IsNumeric(truc) Then MsgBox CSng(truc), vbInformation, truc & " ="
truc = "1 000.55"
If IsNumeric(truc) Then
' Impossible, la condition IsNumeric(truc) est False
Else
MsgBox truc & " n'est pas considéré comme numérique", vbInformation, truc & " ="
End If
truc = Replace(truc, ".", ",")
If IsNumeric(truc) Then MsgBox CSng(truc) & " après remplacement du point par une virgule", vbInformation |
Partager