Dim t$, espace As Boolean 'variables mémorisées
Private Sub TextBox1_KeyPress(ByVal K As MSForms.ReturnInteger)
Dim L%, p%
t = TextBox1: L = TextBox1.SelLength
If K = 47 And L Then
K = 0
p = TextBox1.SelStart
[A1] = Mid(t, p + 1, L)
[A1].CheckSpelling SpellLang:=1036
TextBox1 = Left(t, p) & [A1] & Mid(t, p + L + 1)
[A1] = ""
Else
espace = K = 32
End If
End Sub
Private Sub TextBox1_Change()
Dim d%, p%
If Not espace Then Exit Sub
espace = False
With TextBox1
For d = 1 To Len(.Text)
If Mid(.Text, d, 1) <> Mid(t, d, 1) Then Exit For
Next
p = InStrRev(RTrim(Left(t, d - 1)), " ")
If Not Application.CheckSpelling(RTrim(Mid(t, p + 1, d - 1 - p))) _
Then .SelStart = p: .SelLength = d - 1 - p
End With
End Sub