Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) If Len(TextBox1.Text) = 2 Or Len(TextBox1.Text) = 5 Then TextBox1.Text = TextBox1.Text & "/" SendKeys "{End}", True End If End Sub