Option Explicit
Dim bchange As Boolean
Private Sub TextBox1_Change()
If Not bchange Then
bchange = True
TextBox1.Text = Format(Val(Replace(TextBox1, "-", "")), "0-00-00-00-000-000")
bchange = False
End If
End Sub
Private Sub UserForm_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii < 47 Or KeyAscii > 58 Then KeyAscii = 0
End Sub