Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
With TextBox1
v = .Text
Select Case KeyCode
Case 96 To 105, 48 To 57
If KeyCode < 96 Then KeyCode = KeyCode + 48
Select Case Len(v): Case 1, 4, 7, 10, 14, 18: v = v & " ": End Select
v = v & Chr(KeyCode - 48)
Select Case Len(v): Case 1, 4, 7, 10, 14,18: v = v & " ": End Select
.Text = Mid(v, 1, 14)
Case 8
v = Mid(v, 1, Len(v) - 1)
Case 13, 9
Case 46: v = Mid(v, 1, .SelStart + 1)
Case Else
End Select
.Text = Mid(v, 1, 21)
KeyCode = 0
End With
End Sub