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

[µo°Ý] ¦p¦ó¤j¶q«Ø¥ßCOMBOBOX ªí³æ¤è¦¡

[µo°Ý] ¦p¦ó¤j¶q«Ø¥ßCOMBOBOX ªí³æ¤è¦¡

¤j®a¦n
    ¤p§Ì³Ìªñ·Q¨Ï¥ÎVBA«Ø¥ß¦Û¤vµe­±ªº¤U©Ô¦¡ªí³æ¥\¯à¡A¦ý¦]¬°¬ÛÃö¿ï³æ¹ê¦b¤Ó¦h¡A¦³¤°»ò¤ñ¸û§Öªº¤è¦¡§@«Å§i¶Ü??
¨Ò¦p¥H¤U¡G¥ú¤@­ÓCOMBOBOX1´N¦³32­Ó»Ý­n«Å§i
¦ÓCOMBOBOX¤S¦³20­Ó»Ý­n°µ¤@¼Ëªº«Å§i
³o¼Ë§Ú´N¥²¶·¼g32*20=640­Ó
ÁöµM¥i¥H°µ¡A¦ý¹ê¦b¬O¤Ó¦ûª©­±¡A©Ò¥H¦³¤°»ò¦n«Øij¶Ü??


ComboBox1.AddItem "aiSV4"     '----------------1
ComboBox1.AddItem "aiSV20"     '----------------2
ComboBox1.AddItem "aiSV40"     '----------------3
ComboBox1.AddItem "aiSV80"    '----------------4
ComboBox1.AddItem "aiSV160"    '----------------5
ComboBox1.AddItem "aiSV360"    '----------------6
ComboBox1.AddItem "aiSV4/4"    '----------------7
ComboBox1.AddItem "aiSV4/20"    '----------------8
ComboBox1.AddItem "aiSV20/20"    '----------------9
ComboBox1.AddItem "aiSV20/40"   '----------------10
ComboBox1.AddItem "aiSV40/40"   '----------------11
ComboBox1.AddItem "aiSV40/80"   '----------------12
ComboBox1.AddItem "aiSV80/80"   '----------------13
ComboBox1.AddItem "aiSV80/160"   '----------------14
ComboBox1.AddItem "aiSV160/160"  '----------------15
ComboBox1.AddItem "aiSV4/4/4"   '----------------16
ComboBox1.AddItem "aiSV20/20/20" '----------------17
ComboBox1.AddItem "aiSV20/20/40" '----------------18
ComboBox1.AddItem "aiSV40/40/40" '----------------19
ComboBox1.AddItem " "            '----------------20
ComboBox1.AddItem "aiSV10 HV"   '----------------21
ComboBox1.AddItem "aiSV20 HV"  '----------------22
ComboBox1.AddItem "aiSV40 HV"  '----------------23
ComboBox1.AddItem "aiSV80 HV"  '----------------24
ComboBox1.AddItem "aiSV180 HV" '----------------25
ComboBox1.AddItem "aiSV360 HV" '----------------26
ComboBox1.AddItem "aiSV10/10 HV" '----------------27
ComboBox1.AddItem "aiSV20/20 HV" '----------------28
ComboBox1.AddItem "aiSV20/40 HV" '----------------29
ComboBox1.AddItem "aiSV40/40 HV" '----------------30
ComboBox1.AddItem "aiSV40/80 HV" '----------------31
ComboBox1.AddItem "aiSV80/80 HV" '----------------32

§â¥i¥H³W«h¤Æªº³¡¤À©î¶}¨Ó¥Î For ¨ú¥N

ex
ComboBox1.AddItem "aiSV20/20"    '----------------9
ComboBox1.AddItem "aiSV20/40"   '----------------10
ComboBox1.AddItem "aiSV40/40"   '----------------11
ComboBox1.AddItem "aiSV40/80"   '----------------12
ComboBox1.AddItem "aiSV80/80"   '----------------13
ComboBox1.AddItem "aiSV80/160"   '----------------14
ComboBox1.AddItem "aiSV160/160"  '----------------15

for w = 20  to 140 Step 20
ComboBox1.AddItem "aiSV" &  w &  "/"  & w   
ComboBox1.AddItem "aiSV" &  w &  "/"  & (w  *2  )
next

TOP

¦^´_ 1# lichang
  1.     Dim ar
  2.     '¦³´X­Ó¶ñ´X­Ó
  3.     ar = Array("aiSV4", _
  4.                 "aiSV20", _
  5.                 "aiSV40", _
  6.                 "aiSV80", _
  7.                 "aiSV160")
  8.                     
  9.     'combobox1 to combobox20
  10.     For i = 1 To 20
  11.         Controls("ComboBox" & i).List = ar
  12.     Next
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 3# stillfish00

¶W±j¡AÁÂÁ±zªº¸Ñ´b!!
´ú¸Õok!!

TOP

¥»©«³Ì«á¥Ñ mark15jill ©ó 2015-3-30 23:30 ½s¿è

¦^´_ 3# stillfish00

¯d´X­Ó¥ñµ§Åý§A½m²ß...
¥H¤Uµ{¦¡½X¬°°ÊºA³Ð 8*4 ­Ócombobox   ¨C­Ócombobox ¦Û°Ê¥[¤J 32µ§¸ê®Æ(½d¨ÒÀÉ  ¸ê®Æ§Ú¬O¥á¦bEÄæ¦ì)
¸m©ó °ÊºA·s¼Wªºcombobox Åܧó®É¡A´N­n©p¦Û¤v¥h³]©w·Q­nªº¥\¯à+ÅܼƤF~


  1. Dim  thecombobox() As New Class1 '°ÊºA°}¦C «Å§i¬°·sªºClass1ª«¥óÃþ§Oª«¥ó

  2. Private Sub ComboBox1_Change()

  3. End Sub

  4. Private Sub CommandButton1_Click()
  5.      Dim mycombobox1 As MSForms.ComboBox

  6.     Dim Sh As Worksheet
  7.      Set Sh = ActiveSheet

  8.     kk = 1

  9.     For sjy = 1 To 400 Step 100

  10.         For sja = 1 To 800 Step 100

  11.             With Frame1.Controls.Add("forms.combobox.1")
  12.                 Sh.Cells(kk, 3) = .Name
  13.                 .Left = 10 + sja
  14.                 .Top = 10 + sjy
  15.                 .Width = 90
  16.                 .Height = 20

  17.                 .TextAlign = fmTextAlignCenter

  18.                 .BackColor = &HFFFFC0

  19.                 '.a = Sh.Cells(kk, 1)
  20.                  ReDim Preserve thecombobox(0 To kk - 1)              '­«·s°t¸m °ÊºA°}¦C
  21.                 Set thecombobox(kk - 1).xlcombobox = Controls(.Name)
  22.                 '°ÊºA°}¦Cªº¤¸¯À «ü©w¨ìª«¥ó¼Ò²Õ¤ºªºª«¥ó
  23.             For ewk = 1 To 32
  24.                  eee = Cells(ewk, 5)
  25.                 thecombobox(kk - 1).xlcombobox.AddItem (eee)
  26.             Next
  27.             End With

  28.             kk = kk + 1

  29.         Next

  30.     Next

  31. End Sub

  32. Private Sub UserForm_Click()

  33. End Sub
½Æ»s¥N½X
¦Û³Ðcheckbox®Ö¿ï §¹¦¨ª©5 ¤U©Ô´ú¸Õ.rar (26.84 KB) ¦Û³Ðcheckbox®Ö¿ï §¹¦¨ª©5 ¤U©Ô´ú¸Õ.rar (26.84 KB)

  ¦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# stillfish00

¨º½Ð°Ý¤@¤U³á!!¨º§ÚªºCOMBOBOX_CLICK ¦³¿ìªk¤@¼Ëªº¤è¦¡³B²z¶Ü??

TOP

¦^´_ 6# lichang
¦pªG­n¦@¥Î Click ªºÄ²µo¦æ¬°(´N¬O¦@¥Îclick event)
´N­n¹³ #5¼Ó³o¼Ë , §ï¥Îª«¥óÃþ§O¼Ò²Õ³á~
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 6# lichang
¤U­±¬O¤@²³æ¨Ò¤l
form1.JPG
UserForm1 µ{¦¡½X
  1. Private Temp() As Class1

  2. Private Sub UserForm_Initialize()
  3.     Dim i As Long
  4.     For i = 1 To 4
  5.         ReDim Preserve Temp(i)
  6.         Set Temp(i) = New Class1
  7.         Temp(i).InitialControl Controls("ComboBox" & i)
  8.     Next
  9. End Sub
½Æ»s¥N½X
·s¼Wª«¥óÃþ§O¼Ò²Õ Class1
  1. Public WithEvents ComboBox As MSForms.ComboBox

  2. Private Sub ComboBox_Change()
  3.     MsgBox ComboBox.Value    'change °Ê§@
  4. End Sub

  5. Public Sub InitialControl(ByRef oControl As MSForms.ComboBox)
  6.     Set ComboBox = oControl
  7.     ComboBox.List = Array("test1", "test2", "test3", "test4")
  8. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦nªº¡A§Ú¸Õ¬Ý¬Ý¡AÁÂÁ«ü±Ð!!

TOP

¦^´_ 8# stillfish00

§A¦n¡A½Ð°Ý¤@¤U¡A§Ú²{¦b´ú¸Õ¡A½T¹ê¦³ÅܰʤF¡A¦ý¬O§Ú·Q«ö³y¤£¦P®æ¼Æ«Ø¥ß¿ï¾Üªí³æ
¨Ò¦p¡G²Ä¤@¿ï³æ¡A«Ø¥ß¦ba1
           ²Ä¤G¿ï³æ¡A«Ø¥ß¦ba2
½Ð°Ý¸Ó¦p¦ó¨Ï¥Î©O??
(i¦n¹³¨S¿ìªkª½±µ±a¹L¨Óchange¨Ï¥Î)

TOP

        ÀR«ä¦Û¦b : ¦a¤WºØ¤Fµæ¡A´N¤£©öªø¯ó¡F¤ß¤¤¦³µ½¡A´N¤£©ö¥Í´c¡C
ªð¦^¦Cªí ¤W¤@¥DÃD