__________________Huruf_________________
__________________Angka________________
Public Sub Huruf(ByRef KeyAscii As Integer) If Not (KeyAscii >= Asc("1") & Chr(13) And KeyAscii <= Asc("a") & Chr(13) Or (KeyAscii >= Asc("Z") & Chr(13) And KeyAscii <= Asc("Z") & Chr(13) Or KeyAscii = vbKeyBack Or KeyAscii = vbKeyDelete Or KeyAscii = vbKeySpace)) Then KeyAscii = 0 End If End SubPemakaian :
Private Sub Text1_KeyPress(KeyAscii As Integer) Huruf KeyAscii End Sub
__________________Angka________________
Public Sub Huruf(ByRef KeyAscii As Integer) If Not (KeyAscii >= Asc("1") & Chr(13) And KeyAscii <= Asc("1") & Chr(13) Or (KeyAscii >= Asc("0") & Chr(13) And KeyAscii <= Asc("Z") & Chr(13) Or KeyAscii = vbKeyBack Or KeyAscii = vbKeyDelete Or KeyAscii = vbKeySpace)) Then KeyAscii = 0 End If End SubPemakaian :
Private Sub Text1_KeyPress(KeyAscii As Integer) Huruf KeyAscii End Sub
0 comments:
Post a Comment