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

vba ÃöÁä¦r¬d¸ß¦bÂà¼g

vba ÃöÁä¦r¬d¸ß¦bÂà¼g

¥»©«³Ì«á¥Ñ man65boy ©ó 2015-9-8 18:43 ½s¿è

¥i§_¦bÃöÁä¦r¬d¸ßbÄæ«á¡A§â¥L½s¸¹ªº¸ê®Æ¦bLabel3¤W§e²{¡A¨Ò¦p:
ListBox1ÂI¿ï«á(¿i¥úÅKªO9'*8)¡ALabel2¥X²{(¿i¥úÅKªO9'*8)¡A
Label3¥X²{(1006)¬Û¹ïªº¸ê®Æ¡A¦A«ö"Âà¼g"§âLabel2ªº¸ê®ÆÂà¼g¨ìH1Àx¦s®æùØ¡ALabel3ªº¸ê®ÆÂà¼g¨ìH2Àx¦s®æùØ¡C¦³³Ò¦Ñ®v­Ì¸ÑÃD!
³oÀɮ׬O¦b³o°Q½×°Ï¤@¦ì¦Ñ®vªº§@«~¡A¤p§Ì¾ÇÃÀ¤£ºë¡AµLªkÀ³¥Î¡C
©ú²Ó¬d¸ß.rar (51.08 KB)

  1. Private Sub CommandButton1_Click()
  2. With Sheets("Sheet1")
  3.     .[H1].Value = Label2.Caption
  4.     .[H2].Value = Label3.Caption
  5. End With
  6. End Sub
  7. ¡@
  8. Private Sub ListBox1_Change()
  9. Label2.Caption = ListBox1.Column(0)
  10. Label3.Caption = ListBox1.Column(1)
  11. End Sub
  12. ¡@
  13. Private Sub TextBox1_Change()
  14. Dim i, Arr, xD, N&
  15. If TextBox1 = "" Then GoTo 101
  16. Arr = Sheet1.UsedRange.Columns("A:B").Cells
  17. Set xD = CreateObject("Scripting.Dictionary")
  18. For i = 2 To UBound(Arr)
  19. ¡@¡@If InStr(Arr(i, 2), TextBox1) Then N = N + 1: xD(N) = Array(Arr(i, 1), Arr(i, 2))
  20. Next i
  21. If N = 0 Then GoTo 101
  22. ListBox1.List = Application.Transpose(Application.Transpose(xD.items))
  23. ListBox1.Visible = True
  24. Exit Sub
  25. 101:
  26. Label2.Caption = "": Label3.Caption = "": ListBox1.Visible = False
  27. End Sub
  28. ¡@
  29. Private Sub UserForm_Initialize()
  30. ListBox1.Visible = False
  31. End Sub
½Æ»s¥N½X
ªþ¥ó¤U¸ü¡G
©ú²Ó¬d¸ßv01.rar (53.28 KB)
¡@

TOP

¥»©«³Ì«á¥Ñ man65boy ©ó 2015-9-9 00:08 ½s¿è

¦^´_ 2# ­ã´£³¡ªL

ÁÂÁ¤j®v¯Åªº­ã¤j¸ÑÃD¡A§¹¥þ²Å¦X¡A­ã¤j¦bª¾ÃÑ+ªºª¾ÃÑ°^Äm¡A¯u¬O¥O¤p§Ì¦n¨ØªA¡A¤§«e³£¦³¦b°lÂÜ­ã¤jªºª¾ÃÑ¡A¼K¼K!
­ã¤jªº¦W¨¥:
¡Õ­ã´£³¡ªL¡Öª¾ÃÑ+¡DÂI¼Æ¦³¦h¦³¤Ö¡D¤½¥J´«¤£¤F¡D·Oµ½®½¤£¤F¡Dªù²¼©è¤£¤F¦h¤F´I¤£¤F¡D¤Ö¤F¦º¤£¤F¡D¾÷¤ß°l²Ö¦ó®É¤Fª¾ÃÑ+¡DÀY»Î¦³°ª¦³§C¡D¦W¤ù¦L¤£¤F¡D©ÛµP±¾¤£¤F¡D¹Ó»x¨è¤£¤F°ª¤F¶Æ¤£¤F¡D§C¤F²Û¤£¤F¡D­W¤ß¿Ñ¨ú¦ó®É¤F ¡@¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡×¡× ºw¤ô®ÄÀ³

ÁÂÁ¦Ѯv!^^

TOP

        ÀR«ä¦Û¦b : §Ú­Ì­n°µ¦nªÀ·|ªºÀô«O¡A¤]­n°µ¦n¤º¤ßªºÀô«O¡C
ªð¦^¦Cªí ¤W¤@¥DÃD