Criando UserForm no VBA - Excel (Parte 2)
Olá pessoal, chegamos a nossa segunda aula, nesse vídeo mostro como criar "formatações" no textbox. Para isso usaremos os eventos CHANGE e KEYPRESS.
Abaixo estou listando as linguagens utilizadas:
--------------------------------------------------------------
If IsNumeric(TextBox3) = True Then
TextBox3 = Format(TextBox3.Text, "#,##0.#0")
End If
--------------------------------------------------------------
TextBox4.MaxLength = 10
If Len(TextBox4) = 2 Or Len(TextBox4) = 5 Then
TextBox4.Text = TextBox4.Text & "/"
End If
--------------------------------------------------------------
If KeyAscii < Asc(0) Or KeyAscii > Asc(9) Then
KeyAscii = 0
End If
--------------------------------------------------------------
TextBox5.MaxLength = 7
If Len(TextBox5) = 2 Then
TextBox5.Text = TextBox5.Text & "/"
End If
--------------------------------------------------------------
If KeyAscii < Asc(0) Or KeyAscii > Asc(9) Then
KeyAscii = 0
End If
Abraço!
Prof Darlan