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

[µo°Ý] ListboxÄæ¦ìÅã¥Üªº°ÝÃD

[µo°Ý] ListboxÄæ¦ìÅã¥Üªº°ÝÃD

½Ð°Ý¤j¤j ¤p§Ì¦bsheet5¦³30´X­ÓÄæ¦ì±qDÄæ¦ì~ANÄæ¦ì ­nÅã¥Ü¦blistbox¤W

¦ý¬O¥X²{¤F°ÝÃD¡G



²Ä¤QÄæ¦ì¥H«á´N¤Þ­zµL®Ä¡A

½s½X¦p¤U¡AÁÂÁ¡C
  1. Dim i As Integer

  2. With Listbox1
  3.     .ColumnCount = 37
  4.     .ColumnWidths = "20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt"
  5. End With

  6. With Sheet5
  7. i = 1
  8. Do While .Cells(i, "A") <> ""
  9.     With Listbox1
  10.     .AddItem
  11.     r = .ListCount
  12.     .List(r - 1, 0) = Sheet5.Cells(i, "D")
  13.     .List(r - 1, 1) = Sheet5.Cells(i, "E")
  14.     .List(r - 1, 2) = Sheet5.Cells(i, "F")
  15.     .List(r - 1, 3) = Sheet5.Cells(i, "G")
  16.     .List(r - 1, 4) = Sheet5.Cells(i, "H")
  17.     .List(r - 1, 5) = Sheet5.Cells(i, "I")
  18.     .List(r - 1, 6) = Sheet5.Cells(i, "J")
  19.     .List(r - 1, 7) = Sheet5.Cells(i, "K")
  20.     .List(r - 1, 8) = Sheet5.Cells(i, "L")
  21.     .List(r - 1, 9) = Sheet5.Cells(i, "M")
  22.     .List(r - 1, 10) = Sheet5.Cells(i, "N")
  23.     .List(r - 1, 11) = Sheet5.Cells(i, "O")
  24.     .List(r - 1, 12) = Sheet5.Cells(i, "P")
  25.     .List(r - 1, 13) = Sheet5.Cells(i, "Q")
  26.     .List(r - 1, 14) = Sheet5.Cells(i, "R")
  27.     .List(r - 1, 15) = Sheet5.Cells(i, "S")
  28.     .List(r - 1, 16) = Sheet5.Cells(i, "T")
  29.     .List(r - 1, 17) = Sheet5.Cells(i, "U")
  30.     .List(r - 1, 18) = Sheet5.Cells(i, "V")
  31.     .List(r - 1, 19) = Sheet5.Cells(i, "W")
  32.     .List(r - 1, 20) = Sheet5.Cells(i, "X")
  33.     .List(r - 1, 21) = Sheet5.Cells(i, "Y")
  34.     .List(r - 1, 22) = Sheet5.Cells(i, "Z")
  35.     .List(r - 1, 23) = Sheet5.Cells(i, "AA")
  36.     .List(r - 1, 24) = Sheet5.Cells(i, "AB")
  37.     .List(r - 1, 25) = Sheet5.Cells(i, "AC")
  38.     .List(r - 1, 26) = Sheet5.Cells(i, "AD")
  39.     .List(r - 1, 27) = Sheet5.Cells(i, "AE")
  40.     .List(r - 1, 28) = Sheet5.Cells(i, "AF")
  41.     .List(r - 1, 29) = Sheet5.Cells(i, "AG")
  42.     .List(r - 1, 30) = Sheet5.Cells(i, "AH")
  43.     .List(r - 1, 31) = Sheet5.Cells(i, "AI")
  44.     .List(r - 1, 32) = Sheet5.Cells(i, "AJ")
  45.     .List(r - 1, 33) = Sheet5.Cells(i, "AK")
  46.     .List(r - 1, 34) = Sheet5.Cells(i, "AL")
  47.     .List(r - 1, 35) = Sheet5.Cells(i, "AM")
  48.     .List(r - 1, 36) = Sheet5.Cells(i, "AN")

  49.     End With
  50.     i = i + 1
  51. Loop

  52. End With
½Æ»s¥N½X

¦^´_ 11# stillfish00


    Dear ¤j¤j

¦W¤l·|¦³­«½Æªº®É­Ô (¦ý¬O³¡ªù +¦W¤l ´N¤£·|­«½Æ) §Ú¥[¤F¤@¬q

If Sheet1.Cells(i, 1) = ListBox1.List(ListBox1.ListIndex, 0) And Sheet1.Cells(i, 2) = ListBox1.List(ListBox1.ListIndex, 1) Then

´N¥i¥H¤F(À³¸Ó...)XD

ÁÂÁ¤j¤jªºÀ°¦£¡I

TOP

¦^´_ 10# lifedidi
¦W¦r·|­«½Æ¶Ü? ¤£·|´N§ï¥Î¦W¦r§PÂ_
If Sheet1.Cells(i, 2) = ListBox1.List(ListBox1.ListIndex, 1) Then

TOP

¦^´_ 9# stillfish00

    CASE.rar (19.83 KB)

Àɮפ¤§Ú­n¬d¸ß¨C­Ó¤Hªº¸ê®Æ¡A

¦ý¬O§Ú³o¼Ëªº¤èªk¥u­n¹J¨ì¦P³¡ªù´N·|¥d¦b²Ä¤@¦ì¡A½Ð¤j¤j«ü±Ð¡AÁÂÁ¡C

TOP

¦^´_ 8# lifedidi
§Ú­n§ì¨ú"³¯¾å©ú" «h ÂI²Ä¤@¦æ Listbox1.value = ¸ê®Æ®wªº­È §Y¥i§ì¨ì¶}ÀY

¬Ý¤£À´¡Aªþ¤WÀÉ®×µ{¦¡¬Ý¬Ý

TOP

¥»©«³Ì«á¥Ñ lifedidi ©ó 2013-12-17 09:56 ½s¿è

¦^´_ 6# stillfish00

¤j¤j¡A½Ð±Ð±z¡G

¤p§Ì²{¦b¥ÎListbox1ªº¸ê®ÆÂI¿ï«á ¥i¥H±N¸ê®Æ®wªº¸ê®Æ¥N¨ìTextbox¤W

§ÚªºListbox1²M³æªº²M³æ°²¦p¦³¨âµ§¸ê®Æ

»s³y³¡¡@³¯¾å©ú¡@¤uµ{®v¡@¨k¡@¢µ¦~
¥Í²£³¡¡@²ø©y¼z¡@±M­û¡@¡@¤k¡@¢¶¦~

ÂI²Ä¤@¦æ Listbox1.value ªº­È¬° »s³y³¡
ÂI²Ä¤G¦æ Listbox1.value ªº­È¬° ¥Í²£³¡

§Ú­n§ì¨ú"³¯¾å©ú" «h ÂI²Ä¤@¦æ Listbox1.value = ¸ê®Æ®wªº­È §Y¥i§ì¨ì¶}ÀY

¦ý¬O¤U­±ªº±¡§Î¡A«h­n§ì²Ä¤GÄæ¦ìªº¸ê®Æ¤~¯à¥¿½T§ì¨ì¡A½Ð°Ý¸Ó«ç»ò§ì©O¡H

»s³y³¡¡@¤ý¤Ñ¤~¡@¤uµ{®v¡@¨k¡@¢²¦~¡@
»s³y³¡¡@³¯¾å©ú¡@¤uµ{®v¡@¨k¡@¢µ¦~
¥Í²£³¡¡@²ø©y¼z¡@±M­û¡@¡@¤k¡@¢¶¦~

ÁÂÁ¡I

TOP

¦^´_ 6# stillfish00

¤£¦n·N«ä §Ú­ì©lªºDATA¬OCOPY¦P¤@­ÓÄæ¸ê®Æ ¾É­P°õ¦æ«áµ²ªG³£ªø¤@¼Ë....

¤j¤j¡AÁÂÁ§A~¤w¸g¸Ñ¨M¤F¡I¡I

TOP

ª½±µ¥Î¤£¦æ¶Ü?
  1. Private Sub UserForm_Initialize()
  2.   Dim ar

  3.   With Sheet5
  4.     ar = .Range(.[a2], .[a2].End(xlDown)).Resize(, 37).Value
  5.   End With
  6.   With ListBox1
  7.     .ColumnCount = 37
  8.     .ColumnWidths = "20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt"
  9.     .List = ar
  10.   End With  
  11. End Sub
½Æ»s¥N½X
¦^´_ 5# lifedidi

TOP

¦^´_ 4# stillfish00


ÁÂÁ¤j¤jªº¤èªk¡A

¤p§Ì¥[¤F¤@¨ÇÅܼÆ(¦]¬°Äæ¦ì¼Æ·|¤@ª½¼W¥[ ±q²Ä¤GÄæ¶}©l§ì¨ì³Ì«á¤@Äæ)¡A¦ý¬O«ç»ò§ï³£§ì¤£¨ì­È¡A

½Ð±Ð¤j¤j¡AÁÂÁ¡C
  1. With Sheet5

  2. i = 2

  3. Do While .Cells(i, "A") <> ""
  4.    
  5. j = ".[A" & i & "]"
  6.    
  7. With Sheet5

  8. ar = .Range(j, j.End(xlDown)).Resize(, 37).Value

  9. End With

  10. Listbox1.List = ar
  11.    
  12. i = i + 1
  13.    
  14. Loop

  15. End With
½Æ»s¥N½X

TOP

¦^´_ 3# lifedidi
­n¯}10Äæ­­¨î¡A1¬O±q .RowSource ¤Þ¥Î¤u§@ªí½d³ò
2¬O¥Î¤Gºû°}¦C¤@¦¸µ¹¨ì .List ¡A¦p¤U
  1. Private Sub UserForm_Initialize()
  2.   Dim ar

  3.   With ListBox1
  4.       .ColumnCount = 37
  5.       .ColumnWidths = "20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt;20 pt"
  6.   End With
  7.   
  8.   With Sheet5
  9.     ar = .Range(.[a1], .[a1].End(xlDown)).Resize(, 37).Value
  10.   End With
  11.   ListBox1.List = ar

  12. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ÀR§¤±`®¦¤v¹L¡B¶¢½Í²ö½×¤H«D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD