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

[µo°Ý] ¦p¦ó±NUserForm¤¤ªºComboBoxÅܦ¨¨Ï¥ÎªÌ¥\¯à?

[µo°Ý] ¦p¦ó±NUserForm¤¤ªºComboBoxÅܦ¨¨Ï¥ÎªÌ¥\¯à?

¥H¹Ï¥ÜÁ|¨Ò~


¹Ï¤WªºCheckBox¬ÒÄÝ©óÅÜ°Ê©~¦h~
§Ú·Q§âCheckBox§ï¦¨ComboBox~
¤è«K­×§ïÅܰʸê®Æ~¦p¦ó±NUserForm¤¤ªºComboBoxÅܦ¨¨Ï¥ÎªÌ¥\¯à?

¥»©«³Ì«á¥Ñ mark15jill ©ó 2012-10-25 14:44 ½s¿è
¥H¹Ï¥ÜÁ|¨Ò~


¹Ï¤WªºCheckBox¬ÒÄÝ©óÅÜ°Ê©~¦h~
§Ú·Q§âCheckBox§ï¦¨ComboBox~
¤è«K­×§ïÅܰʸê®Æ~¦p¦ó±N ...
av8d µoªí©ó 2012-10-25 13:48


¤p§Ìªº§@ªk
¦pªG¤µ¤Ñ¦³ ªí³æA (¨Ò¦p ¹Ï)  ªí³æB(ªÅ¥Õ)
§Ú·|¥ý±N ªí³æA ©Ò¦³¤º®e(Caption ) ¤Î ¦WºÙ (Name) ¶×¥X«á
¥Ñ ªí³æB ¥h±µ¦¬ ¨Ã¦C¥X §PÂ_
¨Ò¦p
ªí³æA ¤§Checkbox ¶×¥X
A1~ A10 = checkbox1.name ~ checkbox10.name  
B1~ B10 =  checkbox1.caption ~ checkbox10.caption

ªí³æB ¤§ Combobox±µ¦¬
list(1 to 10)  = A1~ A10
©Î ¯x°}
List( 1 to 10  ,  1 to 10) = ( A1 ~ A10) , (B1 ~ B10)

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 1# av8d


   §ä¨ì¤F¤@­Ó¤èªk~¦p¤U
Private Sub UserForm_Initialize()
CheckBox51.Caption = ¤u§@ªí2.[C2]
End Sub

¦ý¬O¦pªG­nÅý¥L¶]°j°é~¥H¤U¥X¤FÂI°ÝÃD
Private Sub UserForm_Initialize()
For i = 51 To 77
    Me.Controls("CheckBox" & i).Caption = ¤u§@ªí2.["C" & i-49]
Next
End Sub

°ÝÃDÂI¦b¤u§@ªí2.["C" & i-49]
§Ú·QÅý¥L
¤u§@ªí2.[C2]
¤u§@ªí2.[C3]
¤u§@ªí2.[C4]
¦ý¬O³o­Ó°j°é¿ù»~~§Ú¦b¬ã¨s¬Ý¬Ý~³o°ÝÃD§Ú¦n¹³¹J¨ì¹L¤F~¤j¤j¤]¸Ñ¨M¹L@@

TOP

¦^´_ 3# av8d

¥i¥H ¥Î r  ©M r=r+1..

¥H¤U¬O¤@ºØ¤èªk.
  1. 'userform1
  2. Private Sub CommandButton1_Click()
  3.     For uu = 1 To 25
  4.         With Controls("Checkbox" & uu)
  5.             .Caption = Cells(uu + 1, 1)
  6.         End With
  7.     Next
  8.     UserForm1.Hide
  9.     UserForm2.Show
  10. End Sub

  11. Private Sub UserForm_Initialize()
  12.     Dim mycheckbox1 As MSForms.CheckBox
  13.     With UserForm1
  14.         .Width = 400
  15.         .Height = 400
  16.         .StartUpPosition = 2
  17.     End With
  18.     For soa = 1 To 400 Step 80
  19.         For sob = 1 To 400 Step 80
  20.             With UserForm1.Controls.Add("forms.checkbox.1")
  21.                 .Top = 10 + soa
  22.                 .Left = 10 + sob
  23.                 .Height = 50
  24.                 .Width = 50
  25.                 .Caption = .Name
  26.             End With
  27.         Next
  28.     Next

  29. End Sub
½Æ»s¥N½X
  1. 'userform2
  2. Private Sub UserForm_Initialize()
  3.     Dim mycombobox1 As MSForms.ComboBox
  4.     With UserForm2
  5.         .Height = 400
  6.         .Width = 400
  7.         .StartUpPosition = 2
  8.     End With
  9.     With UserForm2.Controls.Add("forms.combobox.1")
  10.         .Height = 40
  11.         .Width = 100
  12.         .Top = 10
  13.         .Left = 10
  14.         For us = 2 To 26
  15.             .AddItem (UserForm1.Controls("checkbox" & us - 1).Caption)
  16.         Next
  17.     End With
  18. End Sub
½Æ»s¥N½X

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_  av8d


   §ä¨ì¤F¤@­Ó¤èªk~¦p¤U
Private Sub UserForm_Initialize()
CheckBox51.Caption = ¤u§@ ...
av8d µoªí©ó 2012-10-25 14:49



   ¦Ü©ó [c2]ªº¸Ü
¥i¥H¸Õ¥Î range("c2") ¨Ó¨Ï¥Î
¦]¬° [c2] ³o¤èªk ¤p§Ì¤ñ¸û¤£¼ô(²Û·\)

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 3# av8d
Me.Controls("CheckBox" & i).Caption = ¤u§@ªí2.["C" & i-49]  §A³o¸Ì¥X¿ù

¦^´_ 5# mark15jill
¥i¥H¸Õ¥Î range("c2") ¨Ó¨Ï¥Î,¦]¬° [c2] ³o¤èªk ¤p§Ì¤ñ¸û¤£¼ô

[ ¤u§@ªí¤W ª«¥ó©Î¦WºÙ]     ¤£¥i±a¤JÅܼÆ

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2012-10-26 11:23 ½s¿è

¦^´_ 6# GBKEE


    ·PÁ¨â¦ì¤j¤jªºÀ°¦£~
§Ú·Q½Ð°ÝG¤j¤@­Ó°ÝÃD~
¦pªG¬O
Me.Controls("CheckBox" & i).ForeColor = ¤u§@ªí2.Range("F" & i + 1)

©Ò¥H§ÚÀx¦s®æ¤W¥²¶·¬O&XXXXXXXXX&
§ÚÀx¦s®æ¤W=IF(E2="","&H00E0E0E0&",IF(E2="¨k","&H00FFFFC0&",IF(E2="¤k","&H00FFC0FF&")))

¥i¬O¥L«oÅã¥Ü"«¬ºA¤£²Å¦X"@@  ­n¦A¦¸³Â·ÐG¤j¤F!!ÁÂÁÂ!

¸É¥R~­è§ä¨ì¤F¤@¨Ç½u¯Á RGB(rs("red"), rs("green"), rs("blue"))¡A¦ü¥G¬O¨S¥Îªº½u¯Á = =

TOP

¦^´_  GBKEE


    ·PÁ¨â¦ì¤j¤jªºÀ°¦£~
§Ú·Q½Ð°ÝG¤j¤@­Ó°ÝÃD~
¦pªG¬O
Me.Controls("CheckBox" & i) ...
av8d µoªí©ó 2012-10-26 10:55



    §ä¨ì­ì¦]¤F¥h±¼¤@­Ó&§Y¥i

TOP

        ÀR«ä¦Û¦b : ¤£­n¤p¬Ý¦Û¤v¡A¦]¬°¤H¦³µL­­ªº¥i¯à¡C
ªð¦^¦Cªí ¤W¤@¥DÃD