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

[µo°Ý] ½Ð±Ð¦³Ãö¡uªí³æ¡v±±¨î¶µªº»yªk¡I

[µo°Ý] ½Ð±Ð¦³Ãö¡uªí³æ¡v±±¨î¶µªº»yªk¡I

¦U¦ì¥ý¶i¤j®a¦n¡I©êºp¤S¥´ÂZ¤F¡C¤S¦³»yªkªº°ÝÃD·Q½Ð±Ð¡A¤p§Ì§Ú¤w¸g¼g¤F¦³Ãö¡uµû»y¡vªí³æªº»yªk¡A¤º®eºc·Q¬O³o¼Ë¡A¥u­n¨Ï¥ÎªÌÂI«öÁä¡A´N·|¥X²{¿ï¾Üµû»yªºlistbox¡A¤j­P»yªk¦p¤U¡G
Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
  a1 = UserForm1.ListBox1.Value
  Sheets("µû»y").Range("d1") = a1
End Sub
Sub UserForm_Activate()
  With UserForm1.ListBox1
  .AddItem "«~¾Ç­ÝÀu"
    .AddItem "¤Í·R¦P¾Ç"
      .AddItem "«æ¤½¦n¸q"
        .AddItem "¥Í©ÊÃi´²"
  End With
End Sub

EXCEL¬O³o¼Ë
  ®y¸¹         ©m¦W          «öÁä           µû»yÄæ
10101     §õªü¤æ    ¿ï¾Üµû»y
10102     ±i¦Ñ¤j   ¿ï¾Üµû»y
10103     ªL¦Ñ¤d   ¿ï¾Üµû»y
10104

¤p§Ìªº°ÝÃD¬O¡G1.¦p¦ó¥i¥HÅý¨â­Ó«e«áÂI¿ïªºµû»y¦P®É¦s¦b¤@­ÓÀx¦s®æ¡]¨C­Ó¾Ç¥Í­n¦³¨â­Óµû»y¡^
                              2.»yªkSheets("µû»y").Range("d1") = a1 ¥i¥H«ç»ò§ó§ï¡A¦]¬°±µ¤U¨Ó­n¥X²{¦bd2¡Bd3¡Bd4¡Bd5........

¦^´_ 7# Hsieh
·PÁª©¤jªººëÅP¦^´_¡A¤p§Ì¥ý¥h¸Õ¸Õ¡A¦]¬°«Ü¦h»yªk¬Ý¤£À´¡A¥ý¬ã¨s¤@¤U¦A»¡¡I¦A¦¸·PÁ¡C

TOP

¦^´_ 6# skyutm
ª«¥óÃþ§OªºÀ³¥Î¬O±N¦P¤@©Ê½èªºª«¥óÂkÃþ¡A¨Ï¨ä¯à¦@¦P°õ¦æµ{¦¡
¤u§@ªí¼Ò²Õ
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2. If Target.Column = 3 And Target.Count = 1 Then UserForm1.Show 0
  3. End Sub
½Æ»s¥N½X
UserForm1¼Ò²Õ
  1. Private Sub UserForm_Initialize()
  2. With ListBox1
  3.   .AddItem "²¤¦³¶i¨B"
  4.     .AddItem "§V¤O¤£¨¬"
  5.       .AddItem "¾Ç·~ºë¶i"
  6.         .AddItem "Ä~Äò¥[±j"
  7.         Set Obs(0).MyList = ListBox1
  8. End With
  9. With ListBox2
  10.   .AddItem "«~¾Ç­ÝÀu"
  11.     .AddItem "¤Í·R¦P¾Ç"
  12.       .AddItem "«æ¤½¦n¸q"
  13.         .AddItem "¥Í©ÊÃi´²"
  14.         Set Obs(1).MyList = ListBox2
  15. End With
  16. End Sub
½Æ»s¥N½X
ª«¥óÃþ§O¼Ò²Õ(´¡¤J)
  1. Public WithEvents MyList As MSForms.ListBox
  2. Private Sub MyList_Click()
  3. ActiveCell = IIf(ActiveCell = "", MyList, ActiveCell & "¡B" & MyList)
  4. n = IIf(MyList.Name = "ListBox1", "ListBox2", "ListBox1")
  5. If UserForm1.Controls(n).ListIndex <> -1 Then UserForm1.Controls(n).Selected(UserForm1.Controls(n).ListIndex) = False
  6. End Sub
½Æ»s¥N½X
ª«¥óÃþ§OÀ³¥Î.rar (12.93 KB)
play.gif
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 5# Hsieh
¦A¦¸·PÁª©¥D¤j¤jªº¸Ô²Ó¦^µª¡A©Z¥Õªº»¡´N¬O¥\¤O²`«p¤£¦P¡A¼g»yªkªº¤è¦¡¤]¤£¦P¡C¤£¹L«pÁy¥Ö¦a¦A¦¸¥´ÂZ¤@¤U¡A²Ä¤G­Ó°ÝÃD¨Ã¨S¦³¸Ñ¶}¤p§ÌªººÃ´b¡A¥i§_¦A»¡©ú¸Ô²Ó¤@¨Ç¡AÁÂÁ¡I

TOP

¦^´_ 4# skyutm

«ç¼Ë·Q¥X³o¼Ëªº»yªk?
³o°ÝÃDÀ³¸Ó¬O¨C­Ó¼gµ{¦¡ªº¤H³£¦³¤£¦Pªº«ä¦Ò¤è¦V
¥u¬O­n¼g¥X¯à°÷¹F¨ì¥Øªºªº»yªk³q±`¤£¥u¤@ºØ
´N¬Ý­Ó¤H¹ïVBA¨ç¼Æ»P¦UºØ¤èªkªº»{ÃѦh¹è¦Ó²§
³q±`¹ï©ó§PÂ_¦¡ªº¼gªk§Ú«Øij¤f»y¤Æªº¤è¦¡¨Ó¸ÑŪ
§â¤f»y¸ÜÂনEXCEL©Ò¯à±µ¨üªºVBA»y¨¥´N¥i¹F¦¨¥Øªº
¥H¥»ÃD¬°¨Ò¡A¼Ó¥D­ì¥»¦bCÄæ³]©wµ{±Ò°Êªí³æªº¤è¦¡
³o­nÅý¤u§@ªí§ä¨ì¼g¤Jªº¥Ø¼ÐÀx¦s®æ·|¦³§xÃø
¦]¬°­YCÄæ³]¸m«Ü¦h«ö¶s¡A¨º»ò«ö¤U«ö¶s«áªºÀx¦s®æ­n¦p¦ó©w¦ì?¤S·|²£¥Í°ÝÃD
©Ò¥H§Q¥ÎWorkSheetªºSelection_Change¨Æ¥ó´N¯à½T©w¿é¤J¥Ø¼Ð¦ì¸m´N¬O§@¥Î¤¤ªºÀx¦s®æ

¦Ü©ó²Ä¤G­Ó°ÝÃD«h¥i¥H±N¨C­Ó­n·í¦¨¿é¤JªºListBox³]¸mµ{ª«¥óÃþ§O¨Ó¾Þ§@§Y¥i¹F¦¨
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

©êºp¡Iª©¥D¤j¤j¦A¦¸¥´ÂZ¤F¡A¤p§Ì¦³¨ÇºÃ´b¡A½Ð°Ý¤@¤U³o­Ó»yªk¡G
ActiveCell = IIf(ActiveCell = "", a1, ActiveCell & "¡B" & a1)
¬O³o¼Ë¸ÑÄÀ¶Ü¡H¶}±ÒªºÀx¦s®æ¡×¦pªGÀx¦s®æ¦¡ªÅªº¡A´N¿é¤Ja1¡A¦pªG¤£¬O¡A´N¿é¤JÀx¦s®æ¤º®e©M¡B©Ma1
½Ð°Ý¡G1.³o¼Ëªº»yªk¬O«ç¼Ë·Q¥X¨Ó
             2.¦pªG¦]¬°µû»y¤Ó¦h¡A¥²¶·¤À¦¨¦n´X­Ólistbox¡A¨ºÀ³¸Ó«ç»ò§ï¼g¡HÁÂÁÂ

TOP

¦^´_ 2# Hsieh
¤Ñ°Ú¡I¤£¬O§Ú·R©ç°¨§¾¡C«ç»ò·|¦³³o»ò¸ÔºÉªº¤¶²Ð¡C¯u¬O¤Ó·PÁ¤F¡I

TOP

¦^´_ 1# skyutm
play.gif
UserForm1¼Ò²Õ
  1. Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
  2.   a1 = ListBox1.Value
  3.   ActiveCell = IIf(ActiveCell = "", a1, ActiveCell & "¡B" & a1)
  4. End Sub

  5. Private Sub UserForm_Initialize()
  6.   With ListBox1
  7.   .AddItem "«~¾Ç­ÝÀu"
  8.     .AddItem "¤Í·R¦P¾Ç"
  9.       .AddItem "«æ¤½¦n¸q"
  10.         .AddItem "¥Í©ÊÃi´²"
  11.   End With
  12. End Sub
½Æ»s¥N½X
µû»y¤u§@ªí¼Ò²Õ
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2. If Target.Column = 3 And Target.Count = 1 Then UserForm1.Show 0
  3. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¹D¼w¬O´£ª@¦Û§Úªº©ú¿O¡A¤£¸Ó¬O¨þ¥¸§O¤HªºÃ@¤l¡C
ªð¦^¦Cªí ¤W¤@¥DÃD