Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If Len(TextBox1) > 5 Then TextBox1 = Left(TextBox1, 5)
TextBox1.Text = Replace(TextBox1.Text, "-", "")
x = Len(TextBox1)
For k = 1 To 5
If Len(TextBox1) <= 4 Then TextBox1 = TextBox1 & "-"
Next
TextBox1.SelStart = x
End Sub
Private Sub UserForm_Activate()
TextBox1 = "-----"
TextBox1.SelStart = 0
End Sub