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

private sub ®É¶¡¤[¤F§Ñ°O¦W¦r¦p¦ó§ä¥X¨Ó.

private sub ®É¶¡¤[¤F§Ñ°O¦W¦r¦p¦ó§ä¥X¨Ó.

¦U¦ì¤j¤j ¤@¯ëÊúSUB «öALT + F11 §Y¥i¬Ý¨£.¦ýprivate sub «o­n¿é¤J¦W¦r¤~¥i¬Ý¨£,¦pªG§Ñ¤F¦W¦r­n¦p¦ó§ä¥X¨Ó

¦^´_ 1# ANGELA
«ü¥O->¤u¨ã->¿ï¶µ->µøµ¡³]©w->¤Ä¿ï ¹w³]¥þ¼Ò²ÕÀ˵ø
©Î¦p¹Ï:

TOP

¥»©«³Ì«á¥Ñ HUNGCHILIN ©ó 2010-5-17 22:02 ½s¿è

³o«h°ÝÃD¸ò³o©«¦³ÃöÁp©Ê¶Ü?ÃD¥Ø«Ü©_©Ç©Ò¥H§Ú·Q¨ì³o¤@©«
¨Ã¤£¬O©Ò¦³¤H³£ª¾¹Dsub»Pprivate sub¬O¤°»ò­n«ç»ò¥Î

[­ì³Ð] ¸T¤î¨Ï¥ÎªÌ¨Ï¥ÎEXCEL VBE½s¿è¾¹
¯¦³Z:
¦]¬°¥L¬O private sub  ©Ò¥H·|¬Ý¤£¨ìµ{¦¡
¥¦¬O¨p¥Îµ{¦¡¤£¬O¤½¥Îµ{¦¡
¦ý¬O·í§Aª½±µ¿é¤Jµ{¦¡¦WºÙ«áµM«á°õ¦æ¥Lµ{¦¡¬O¥i¥H¥Îªº
¥u¬O¬Ý¤£¨ì©Ò¥H´N¤£¯à¥Î¿ïªº´N¬O¤F­n¦Û¤v¿é¤J

http://forum.twbts.com/viewthread.php?tid=83&extra=page%3D1
---------------------------------------------------------------------------------------------------

private sub ¸ò¤@¯ëSUB¦b¶}±ÒªºVBEµøµ¡¼Ò²Õ¤¤ÁÙ¬O¬Ýªº¨ì§äªº¨ìªº
¥D­n®t²§¬Osub ¦b¤u¨ã/¥¨¶°/¥¨¶°°õ¦æµøµ¡¤¤ ¬Ýªº¨ì¤]¿ïªº¨ì
private sub¦b¥¨¶°°õ¦æµøµ¡¤¤ ¬Ý¤£¨ì¤]¿ï¤£¨ì¥u¯à¦Û¤v¿é¤J
  
---------------------------------------------------------------------------------------------------

¦pªG¬O¦]¦¹©«¦Ó²£¥Íªº·P·Q»P¾Ç²ß
µªÂЦp¤U§Æ±æ¹ï§A¦³À°§U
±M®×³QÂê©w¤Uprivate sub­Y¨S¦³¥Î"¯S»sµ{¦¡Åª¥X¦WºÙ"°ò¥»¤W¬Ý¤£¨ìªº
³q±`­n¶}±Ò±M®×¤~¯à¬Ý¨ìprivate sub

TOP

ÁÂÁ¤j¤jªº»¡©ú,¤£ª¾¹D§Úªº¤F¸Ñ¬O§_¥¿½T,¤]´N¬OPRIVATE SUB ¦pªG¸ò¨ä¥L¤½¥ÎSUB ©ñ¦b¤@°_,¥u­n¥s¥X¤½¥ÎSUB ´N¥i¬Ý¨ìPRIVATE SUB ¦pªG³æ¿W¦s¦b´N¥u¯à¥ÎPRIVATE SUB ªº¦W¦r¥s¥X¤F.

TOP

½Ð±Ð¦U¦ì«e½ú¤@­Ó°ÝÃD
¦b sub¤½¦¡¤º¥i¥Î call ¨Ó©I¥s ¥t¤@­Ó sub  ¦p
  sub kk()
   --------
   call a     ( a ¬O¥t¤@­Ó sub )
--------

  §Ú¦³¤@­ÓºÃ°Ý  ¦b sub ¤º ¥i§_©I¥s ¥t¥~¤@­Ó private sub c () ¥Î¦ó¤è¦¡©I¥s ?
                      ¦b private sub ¤º ¥i§_©I¥s ¥t¥~¤@­Ó sub k () ¥Î¦ó¤è¦¡©I¥s ?

TOP

¦^´_ 5# jim


    Private Sub c()

MsgBox "1"
End Sub
Sub kk()

c
End Sub
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 5# jim
Call ¥u¥i¥G¥s Public Sub µLªk ¥G¥s Private Sub
¥ÎRun  ¥i¥G¥s Public Sub ¤Î Private Sub
ª«¥ó¼Ò²Õ (ThisWorkbook,Sheet1,Sheet12.....):
¨Ò¦p¦ì¦bSheet1®É ¤£ºÞ¬O Private Sub TEST() ©Î¬O Sub TEST()    ¬Ò¥Î   Run "Sheet1.TEST"
¤@¯ë¼Ò²Õ(Module):
¤£ºÞ Sub  ¬O§_¬O Private Sub TEST() ©Î¬O Sub TEST()               ª½±µ¥Î  Run ".TEST"

TOP

¦^´_ 7# GBKEE
½Ð°Ý¤j¤j.§Ú¥­±`¦b  SUB A   RUN  SUB  B®É,³£¤£¥ÎCall ©MRUN,¥u¥´SUB ªº¦W.
¥ÎCall ©MRUN©M¤£¥Î¦³¤°»ò¦n³B?
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

GBKEE  Tks

TOP

¦^´_ 8# basarasy
Call Test ->©I¥s  Sub Test
Test  ->   ¤@¼Ë¬O©I¥s  Sub Test
Call   ¤£¥i©I¥s Private ªºµ{§Ç
Run  ¥i©I¥s Private ªºµ{§Ç

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD