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

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

¦^´_ 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

¦^´_ 11# stillfish00

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

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

¦^´_ 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

¦^´_ 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

¦^´_ 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

¦^´_ 16# stillfish00

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

TOP

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