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

[µo°Ý] ½Ð±Ð¦p¦óÅýListBox1¤w¸g¿ï¨ú¹Lªº¤£¯à¦A¦¸ÂI¿ï

[µo°Ý] ½Ð±Ð¦p¦óÅýListBox1¤w¸g¿ï¨ú¹Lªº¤£¯à¦A¦¸ÂI¿ï

½Ð±Ð¦p¦óÅýListBox1¤w¸g¿ï¨ú¹Lªº¤£¯à¦A¦¸ÂI¿ï
¦p¦ó±N¿ï³æ¤Ï¥ÕµLªk¿ï¨ú©Î¬O±N¸Ó²M³æ²¾°£
ÁÂÁÂ!!!
  1. Private Sub ListBox1_Click()
  2.         Sheets(1).Select
  3.         Cells.Interior.ColorIndex = xlNone
  4.             For j = 1 To ListBox1.ListCount - 1
  5.                 If ListBox1.Selected(j) = True Then
  6.                     gx = ListBox1.Value
  7.                     Set cx = Sheets(1).Cells.Find(gx, after:=[A1])
  8.                     If cx Is Nothing Then
  9.                         ActiveCell = ListBox1.Value
  10.                         If ActiveCell.Column = 1 Then
  11.                             ActiveCell.Offset(1, 0).Select
  12.                         Else
  13.                             ActiveCell.Offset(0, -1).Select
  14.                         End If
  15.                     Else
  16.                         cx.Interior.ColorIndex = 3
  17.                         MsgBox "¦W³æ­«½Æ¥[¤J" & cx.Address
  18.                     End If
  19.                 End If
  20.             Next
  21. End Sub
½Æ»s¥N½X

¸É¥R
²M³æªº¸ü¤J¬O±q¥t¤@­ÓSheets
  1. Private Sub ComboBox1_Change()
  2.     If Me.ComboBox1.ListIndex > 0 Then
  3.         Me.ListBox1.Visible = True
  4.             i = Me.ComboBox1.ListIndex
  5.             Sheets("¾r¾p").Select
  6.             X = Cells(65536, i + 1).End(xlUp).Row
  7.             ListBox1.Height = 20 * X
  8.             UserForm.Height = 15 * X + 60
  9.             ListBox1.Clear
  10.                 For Each xR In Range(Cells(2, i + 1), Cells(X, i + 1))
  11.                       ListBox1.AddItem xR.Value
  12.                 Next
  13.             ListBox1.ListIndex = 0
  14.             Sheets(1).Select
  15.     End If
  16. End Sub
  17. Private Sub ListBox1_Click()
  18.         Sheets(1).Select
  19.         Cells.Interior.ColorIndex = xlNone
  20.             For j = 1 To ListBox1.ListCount - 1
  21.                 If ListBox1.Selected(j) = True Then
  22.                     gx = ListBox1.Value
  23.                     Set cx = Sheets(1).Cells.Find(gx, after:=[A1])
  24.                     If cx Is Nothing Then
  25.                         ActiveCell = ListBox1.Value
  26.                         If ActiveCell.Column = 1 Then
  27.                             ActiveCell.Offset(1, 0).Select
  28.                         Else
  29.                             ActiveCell.Offset(0, -1).Select
  30.                         End If
  31.                     Else
  32.                         cx.Interior.ColorIndex = 3
  33.                         MsgBox "¦W³æ­«½Æ¥[¤J" & cx.Address
  34.                     End If
  35.                 End If
  36.             Next
  37. End Sub

  38. Private Sub UserForm_Initialize()
  39.     Me.ListBox1.Visible = False
  40.     Rx = Sheets("¾r¾p").[A65536].End(xlUp).Row
  41.     Me.ComboBox1.List = Sheets("¾r¾p").Range("A2:A" & Rx).Value
  42.     Me.ComboBox1.ListRows = Rx
  43.     Me.ComboBox1 = "¯Z§O"
  44.     UserForm.Height = 57
  45. End Sub

  46. Private Sub ComboBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  47.     ComboBox1.DropDown
  48.     Me.ListBox1.Visible = False
  49.     Me.ComboBox1 = "¯Z§O"
  50.     UserForm.Height = 57
  51. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# koo

¦bPrivate Sub ListBox1_Click()³oµ{¦¡ªº³Ì«á¥[¤W
     ListBox1.Enabled = False

TOP

¦^´_  koo

¦bPrivate Sub ListBox1_Click()³oµ{¦¡ªº³Ì«á¥[¤W
     ListBox1.Enabled = False
lpk187 µoªí©ó 2015-9-27 11:49


·PÁ¤j¤j¦^´_....¥Ø«e¨Ï¥Î§R°£ªº¤è¦¡­«·s¨ú±o²M³æ
¦ý·s°ÝÃD¤S¨Ó¤F...¿ï¨úª¬ºAµLªk¨ú®ø³y¦¨¸Óµ§²M³æµLªkÂI¿ï
  1. For i = 0 To Me.ListBox1.ListCount - 1
  2.    Me.ListBox1.Selected(i) = False
  3. Next

  4. ListBox1.ListIndex = -1
½Æ»s¥N½X
sshot-4.png sshot-5.png

TOP

¥Ø«e§ï¥ÎListBox1.RemoveItem (i)¦ý¬O·|¤@¦¸¬å°£2µ§
¦pªG¨Ï¥Î¥H¤Uµ{§Ç¤]·|¦]¬°¥LÁÙ¬O¦bÂI¿ïª¬ºA©Ò¥H²£¥Í¿ù»~
½Ð¸ô¹L°ª¤â«ü¾É¤@µf...·PÁÂ
  1.             For i = ListBox1.ListCount - 1 To 0 Step -1
  2.                 If ListBox1.Selected(i) = True Then
  3.                     ListBox1.RemoveItem (i)
  4.                 End If
  5.             Next
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ koo ©ó 2015-9-28 07:01 ½s¿è

¥Ø«e¶i«×¨Ï¥Î
Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
¼È®É¸Ñ¨M
¦ý
ÁÙ¬O½Ð°ª¤â«ü¾É¤@¤U¦p¦óÅý¤W­±°ÝÃDªºÂI¿ïª¬ºA¨ú®ø...ÁÂÁÂ

TOP

¦^´_ 6# koo
¸Õ¸Õ¬Ý
  1. If ListBox1.ListIndex > -1 Then
  2.         For i = ListBox1.ListCount - 1 To 0 Step -1
  3.             If ListBox1.Selected(i) = True Then
  4.                 ListBox1.ListIndex = -1
  5.                 ListBox1.RemoveItem (i)
  6.             End If
  7.         Next
  8.     End If
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  koo
¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2015-9-28 08:15



ÁÂÁª©¤j´£¥Ü¥Ø«e¤w¸Ñ¨M:D

TOP

        ÀR«ä¦Û¦b : °µ¸Ó°µªº¨Æ¬O´¼¼z¡A°µ¤£¸Ó°µªº¨Æ¬O·Mè¡C
ªð¦^¦Cªí ¤W¤@¥DÃD