ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð±ÐTextBox¿é¤J¿ù»~¦p¦ó¦^¨ì­ì¦ì¸m

¦^´_ 3# ­ã´£³¡ªL
Cancel = True §Y¥i¨ú®øExit°Ê§@, Åý¾nÂI¯d¦b­ì¦ì
¦P²z
ByVal KeyCode As MSForms.ReturnInteger
  1. Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  2.     If KeyCode = 13 And TextBox1 > "" Then
  3.         Dim Rng As Range
  4.         Dim ax As Variant
  5.         Dim bx As String
  6.         Set Rng = Sheets("data").[K1:L24]
  7.         bx = TextBox1.Text
  8.         ax = Application.VLookup(bx, Rng, 2, 0)
  9.         If Not IsError(ax) Then
  10.             Label4 = ax
  11.         Else
  12.             MsgBox "¿é¤J¿ù»~"
  13.             'TextBox1 = ""
  14.             KeyCode = True
  15.             TextBox1.SelStart = 0
  16.             TextBox1.SelLength = Len(TextBox1)
  17.         End If
  18.     End If
  19. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# ­ã´£³¡ªL
¨S¦³2000¥i¤F¸Ñ
  1. TextBox1.SelStart = 0
  2. TextBox1.SelLength = Len(TextBox1)
½Æ»s¥N½X
¸Õ¸Õ¤£MsgBox, ³o¬qµ{¦¡½X¥i¥Î¶Ü?
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : §g¤l¦p¤ô¡AÀH¤è´N¶ê¡AµL³B¤£¦Û¦b¡C
ªð¦^¦Cªí ¤W¤@¥DÃD