Au final, j'y arrive quand même avec cette solution
Private Sub CommandButton1_Click()
Range("B2") = CDbl(TextBox1.Value)
'Range("B2") = Replace(Replace(TextBox1.Value, ",", "."), " ", "")
Me.Hide
End Sub
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr("0123456789.,", Chr(KeyAscii)) = 0 Then KeyAscii = 0
If KeyAscii = Asc(".") Then KeyAscii = Asc(",")
If InStr(TextBox1, ",") > 0 And KeyAscii = Asc(",") Then KeyAscii = 0
If Len(Split(TextBox1 & ",0", ",")(1)) > 1 Then KeyAscii = 0
End Sub
Private Sub TextBox1_Change()
Application.EnableEvents = False
If InStr(TextBox1.Value, ",") = 0 Then
entier = Replace(TextBox1.Value, " ", "")
x = ""
For i = Len(entier) To 1 Step -1
x = Mid(entier, i, 1) & x
If ((Len(entier) - i + 1) Mod 3 = 0) Then x = " " & x
Next
On Error Resume Next ' effacement
TextBox1.Value = IIf(Left(x, 1) = " ", Mid(x, 2, Len(x) - 1), x)
End If
Application.EnableEvents = True
End Sub