prova cosi
Private Sub textbox1_GotFocus()
textbox1.SelStart = 0
textbox1.SelLength = Len(xl.Text)
End Sub
Private Sub textbox1_KeyPress(KeyAscii As Integer)
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then KeyAscii = 0
End Sub
Private Sub textbox1_Validate(Cancel As Boolean)
Cancel = (Len(textbox1.Text) <> 2)
End Sub