ªð¦^¦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

¦^´_ 16# stillfish00

ÁÂÁ§Aªº¸Ñµª¡A§Ú·|¦A§V¤O¾Ç²ß!!
§Æ±æ¥H«á¯à¤£§[ÀߦA«ü±Ð!!

TOP

¦^´_ 15# lichang
®Ñ¬O¬Ý±o¤£¦h¡A³Ì¦³¦¬Ã¬ªº¬O
Professional Excel Development 2nd
¦ý³o¥»¤£¬Oµ¹¤Jªùªº¤H¬Ýªº¡A¤J§|«e¤T«ä¡C

³Ì¥D­n¬O±`¼g¡A¹J¨ì°ÝÃD¤Wºôgoogle¡A
­n¾Ç·|¤U¹ïÃöÁä¦r¡A¤K¦¨³£¦³µª®×¡C
¦h¼Æµª®×³£·|³sµ²¨ì³o­Ó½×¾Â©ÎExcelHome(©Ò¥H¤~·|¥[¤J³o½×¾Â)
¤¤¤å§ä¤£¨ì¡A§ï­^¤åÃöÁä¦r¡A¦h¥b°ÝÃD·|¦bStackOverflow±o¨ì¸Ñµª

¼g¦h¤F¡A¹J¹L°ÝÃD´N¦h¡A¸Ñ¨M¹Lªº°ÝÃD¤]´N¦h¤F¡A¦p¦¹¦Ó¤w¡C
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 14# stillfish00

ÁÂÁ±zªº¦^ÂСA¤£¹L¦]¬°¹ê¦b¬O¤Ó¦h¿ï³æ¡A©Ò¥H¤~·|·Q¥Î¤@¦¸ºÞ²zªº¤è¦¡°µ!!
³o¼Ë¹ïµ{¦¡¼¶¼g¤]¤ñ¸û¦nºÞ²z¡AÁÙ¦³§Ú¨Ï¥Î±z²Ä¤@­Ó«Øijªº¤è¦¡¡A¤w¸g§¹¦¨´ú¸Õ¡A½T¹ê¬O§Ú­nªºªF¦è
±z¯u¬O¤Ó±j¤F£½!!

ÃD¥~¸Ü¡A½Ð°Ý±z³o¨Çª¾ÃÑ¡A¬O­n¬Ý¨º¨Ç®ÑÄy¤~¯àª¾¹D¦p¦ó¼¶¼g¡A¤è«K´£¨Ñ¤@¤U¶Ü??

TOP

¦^´_ 12# lichang
¤£¹L³q±`·|¬O³z¹L¤@­Ó«ö¶s¥hIJµo
¦A¤@¦¸©Ê§âªí³æ¤Wªº¸ê®Æ§ó·s¨ì¤u§@ªí
¦Ó¤£¬O³z¹LCombobox change event
³o¼Ë¤]¤ñ¸û²³æ
  1. Private Sub CommandButton1_Click()
  2.     With ActiveSheet.Range("B1799")
  3.         For i = 1 To 4
  4.             .Cells(i, 1).Value = Controls("ComboBox" & i).Value
  5.         Next
  6.     End With
  7. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 12# lichang
¤£½T©w¬O¤£¬O§A­nªº : ¨C­ÓComboBox ³£¦³¤@­Ó¹ïÀ³ªºÀx¦s®æ , ¨C¦¸ComboBox¿ï¾Ü§ïÅܮɡA¹ïÀ³ªºÀx¦s®æ­È¤]§ïÅÜ¡C

¦]¬°¨Sµ{¦¡½X§Úª½±µ¥Î 8#ªº¨Ò¤l¨Ó­×§ï
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), ActiveSheet.Cells(1799 + i, "B")
  8.     Next
  9. End Sub
½Æ»s¥N½X
·s¼Wª«¥óÃþ§O¼Ò²Õ Class1
  1. Public WithEvents ComboBox As MSForms.ComboBox
  2. Private linkCell As Range

  3. Private Sub ComboBox_Change()
  4.     linkCell.Value = ComboBox.Value
  5. End Sub

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

TOP

¦^´_ 11# stillfish00

¦p¥H¤Uªþ¹Ï¡A·í§Ú¿ï¾Ü¨ì²Ä¤G­Ó¿ï³æ®É¡A¿ï¾ÜªºªF¦è¦Û¤v«Ø¥ß¨ìB1801¡A¥H¦¹Ãþ±À!!
¤£¦n·N«ä¡A¤@ª½³Â·Ð§A¤F!!

TOP

¦^´_ 10# lichang
¬Ý¤£À´§Aªº·N«ä¡A½Ðªþ¹Ï©ÎÀÉ®×»¡©ú¤@¤U¡AÁÂÁ¡C
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

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

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

TOP

        ÀR«ä¦Û¦b : ¦³¦h¤Ö¤O¶q´N°µ¦h¤Ö¨Æ¡A¤£­n¤ß¦sµ¥«Ý¡Aµ¥«Ý¤~·|¸¨ªÅ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD