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

[µo°Ý] UserForm¤º«ç»ò°µ¬d´M²M³æ?

[µo°Ý] UserForm¤º«ç»ò°µ¬d´M²M³æ?

§Ú·Q­n¦bUserForm¤º°µ¬d´M²M³æ¡C
¦bUserForm2¬d¦n¸ê®Æ"¼t°Ó½s¸¹"

ÂI¤G¤U«áUserForm1"¼t°Ó½s¸¹"´N·|¦³¨ºµ§¸ê®Æ

¼t°Ó«È¤á¸ê®Æ-test.rar (42.35 KB)
excel¾Ç²ß¤¤!¿v¥X¹Ú·Q
https://www.youtube.com/channel/UCPAiRNsHX3k_omp0YDgfDiA

¦Û¤v§ä¨ì¤èªk¸Ñ¶}¤F
RIGHT1111.png
UserForm ¼Ë¦¡¥ý§ï¦¨³o¼Ë
  1. Dim Sh As Worksheet, d As Object, d2 As Object, d3 As Object

  2. ¤½¦¡¦p¤U
  3. Private Sub CommandButton1_Click()
  4. If TextBox1.Text <> "" Then
  5.     '±N TextBox1 ¸ê®Æ©ñ¤J TBox1
  6.     UserForm2.TBox1.Text = TextBox1.Text
  7.     '±N TextBox1 ¸ê®Æ©ñ¤J TBox1
  8.    
  9.     Unload UserForm1
  10.     'Ãö³¬ªí³æ
  11.     Else
  12.     End If
  13. End Sub

  14. Private Sub UserForm_Initialize()
  15.     Dim i As Single, Rng As Range
  16.     Set Sh = Sheets("¦X¬ù¸ê°T")
  17.     '«Å§i SH = Sheets("¦X¬ù¸ê°T")
  18.     Set d = CreateObject("scripting.dictionary")
  19.     '«Å§i d = «Ø¥ß¨Ã¶Ç¦^ ActiveX ª«¥ó «Ø¥ß¤@­Ó Dictionaryª«¥ó
  20.     Set Rng = Sh.Cells(5, "E")
  21.     'SH = Sheets("«È¤á¸ê®Æ") Rng =Àx¦s®æ Cells(²Ä5Äæ,C¦C)
  22.     Do While Rng <> ""
  23.     'Rng = Àx¦s®æ Cells(²Ä5Äæ,C¦C) ¤£µ¥©ó  ªÅ¥Õ
  24.         If d.exists(Rng.Value) = False Then
  25.             '
  26.             Set d(Rng.Value) = Rng
  27.         Else
  28.             Set d(Rng.Value) = Union(Rng, d(Rng.Value))
  29.         End If
  30.         Set Rng = Rng.Offset(1)
  31.     Loop
  32.     ComboBox1.List = d.KEYS
  33.     'ComboBox1 µ¥©ó d KEYS
  34.     TextBox1 = ""
  35.     'TextBox1¸ê®Æ²M°£
  36. End Sub
  37. Private Sub ComboBox1_Change()
  38.     Dim R As Range
  39.     TextBox1 = ""
  40.     Set d2 = CreateObject("scripting.dictionary")
  41.     'd2 = «Ø¥ß¨Ã¶Ç¦^ ActiveX ª«¥ó «Ø¥ß¤@­Ó Dictionaryª«¥ó
  42.     For Each R In d(ComboBox1.Value).Offset(, -1).Cells
  43.         'ComboBox1ªº¸ê®Æ§ä¨ìÀx¦s®æ«á­È -1¦C
  44.         If d2.exists(R.Value) = False Then
  45.         '¦pªG d2 ªº­È¬O¯u´N
  46.             Set d2(R.Value) = R
  47.             'Dictionaryª«¥ó¤ºªº
  48.         Else '§_´N
  49.             Set d2(R.Value) = Union(R, d2(R.Value))
  50.             'd2¤ºªº­È µ¥©ó Union¤ºªº­È
  51.         End If
  52.     Next
  53.     ComboBox2.Clear
  54.     'ComboBox2¸ê®Æ²M°£
  55.     ComboBox2.List = d2.KEYS
  56.     'ComboBox2 µ¥©ó d2 KEYS
  57. End Sub

  58. Private Sub ComboBox2_Change()
  59.     TextBox1 = ""
  60.     If ComboBox2.ListIndex > -1 Then TextBox1.Text = Sh.Cells(d2(ComboBox2.Value).Row, "F")
  61.     'FÄæ
  62.     'ListIndex = -1 ­È¤£¦bList¤¤
  63. End Sub
½Æ»s¥N½X
excel¾Ç²ß¤¤!¿v¥X¹Ú·Q
https://www.youtube.com/channel/UCPAiRNsHX3k_omp0YDgfDiA

TOP

¦^´_ 1# kkooo15


    ª©¥D±z¦n¡A³o2­ÓÀÉ®×(¸Ì­±¦³¦p¤U­±2¼h¥H¤Î5¼hªº Listbox µ¹±z°Ñ¦Ò¬Ý¬Ý¡C



  ÀɮפU¸ü¡G VBA - ¹êÅç§å±M®×ºÞ²z.rar (322.18 KB)

TOP

¦^´_ 3# jeffrey628litw
¤U¨Ó¸Õ¬Ý¬Ý,«D±`·PÁ¡C
excel¾Ç²ß¤¤!¿v¥X¹Ú·Q
https://www.youtube.com/channel/UCPAiRNsHX3k_omp0YDgfDiA

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD