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

¦p¦ó¦b¦Û©wªí³æ¤¤«Ø¥ß¤G¶¥ªº¤U©Ô¦¡¿ï³æ

¦p¦ó¦b¦Û©wªí³æ¤¤«Ø¥ß¤G¶¥ªº¤U©Ô¦¡¿ï³æ

¦U¦ì°ª¤â,
½Ð°Ý¦p¦ó¦b¦Û©wªí³æ¤¤«Ø¥ß¤G¶¥ªº¤U©Ô¦¡¿ï³æ?
°²³]¦Û©wªí³æ¤¤,ComboBox1ªº¸ê®Æ¬OA»PB
§Ú§Æ±æ¦pªGComboBox1¿ï¾ÜA«h¦bComboBox2·|Åã¥ÜA1,A2,A3ªº¿ï¶µ
¦pªGComboBox1¿ï¾ÜB«h¦bComboBox2·|Åã¥ÜB1,B2,B3ªº¿ï¶µ
ÁÂÁÂ

¦^´_ 1# hbjang
  1. Private Sub UserForm_Initialize()
  2. Ar = Array("A", "B")
  3. For i = 0 To UBound(Ar)
  4.     ComboBox1.AddItem Ar(i)
  5. Next i
  6. For i = 1 To 2
  7.     Controls("ComboBox" & i) = ""
  8. Next i
  9. End Sub

  10. Private Sub ComboBox1_Change()
  11. If ComboBox1 <> "" Then
  12.   Select Case ComboBox1
  13.     Case "A"
  14.       Br = Array("A1", "A2", "A3")
  15.     Case "B"
  16.       Br = Array("B1", "B2", "B3")
  17.   End Select
  18.   With Controls("ComboBox2")
  19.     .Clear
  20.     .Value = ""
  21.   End With
  22.   For i = 0 To UBound(Br)
  23.     ComboBox2.AddItem Br(i)
  24. Next i
  25. End If
  26. End Sub
½Æ»s¥N½X

TOP

¦^´_ 1# hbjang
  1. Private Sub ComboBox1_Change()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. d(1) = Array("¥Ò", "¤A", "¤þ", "¤B", "¥³", "¤v", "©°", "¨¯", "¤Ð", "¬Ñ")
  4. d(2) = Array("ª÷", "¤ì", "¤ô", "¤õ", "¤g")
  5. With ComboBox2
  6. .Clear
  7. s = CInt(ComboBox1)
  8. .List = d(s)
  9. End With
  10. End Sub

  11. Private Sub UserForm_Initialize()
  12. With ComboBox1
  13. .List = Array(1, 2)
  14. End With
  15. End Sub
½Æ»s¥N½X
play.gif
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

·PÁ¦U¦ì¤j¤j,°ÝÃD¤w¸g¸Ñ¨M
§Úµy·L­×§ï¤F¤@¤Uµ{¦¡,¦p¤U:
Private Sub UserForm_Activate()
Dim i%
i = Worksheets("Database").Range("A65536").End(xlUp).Row
UserForm1.ComboBox1.List = Worksheets("Database").Range("A3:A" & i).Value
Worksheets("Sheet1").Select
End Sub

Private Sub ComboBox1_Change()
If ComboBox1 <> "" Then
With Controls("ComboBox2")
    .Clear
    .Value = ""
End With

Select Case ComboBox1
Case "ÄåªáµP"
   j = Worksheets("Database").Range("B65536").End(xlUp).Row
   UserForm1.ComboBox2.List = Worksheets("Database").Range("B3:B" & j).Value
Case "ªL¤ºµP"
   k = Worksheets("Database").Range("C65536").End(xlUp).Row
   UserForm1.ComboBox2.List = Worksheets("Database").Range("C3:C" & k).Value
End Select
End If
End Sub

TOP

        ÀR«ä¦Û¦b : µoµÊ®ð¬Oµu¼ÈªºµoºÆ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD