Anda di halaman 1dari 1

Private Sub txtData_KeyPress(ByVal KeyAscii As MSForms.

ReturnInteger)
'Limita a Qde de caracteres
txtData.MaxLength = 8
'para permitir que apenas nmeros sejam digitados
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
KeyAscii = 0
End If
End Sub
Private Sub txtData_Change()
'Formata : dd/mm/aa
If Len(txtData) = 2 Or Len(txtData) = 5 Then
txtData.Text = txtData.Text & "/"
SendKeys "{End}", True
End If
End Sub

Anda mungkin juga menyukai