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

[µo°Ý] ³o­Ó¥i¥H¨Ï¥ÎIF¤½¦¡¶Ü?

¦^´_ 10# appr

¤u§@ªí¼Ò²Õ
  1. Private Sub worksheet_change(ByVal target As Range)
  2. Set RngA = Range("A2:A4")
  3. Set RngB = Range("B2:B4")
  4. Set RngCA = Intersect(target, RngA)
  5. Set RngCS = Intersect(target, RngB)
  6. If Not RngCA Is Nothing Then
  7.    RngCA.Offset(0, 2) = RngCA.Offset(0, 2) + RngCA.Value
  8.    RngCA.Value = ""
  9. End If
  10. If Not RngCS Is Nothing Then
  11.    RngCS.Offset(0, 1) = RngCS.Offset(0, 1) - RngCS.Value
  12.    RngCS.Value = ""
  13. End If
  14. If target.Address = "$D$2" Then
  15.    Range("E2") = Range("D2")
  16. End If
  17. If target.Address = "$E$2" Then
  18.    Range("D2") = Range("E2")
  19. End If
  20. End Sub
½Æ»s¥N½X

TOP

¦^´_ 11# register313


    ÁÂÁÂR¤jªº¦^ÂÐ

©Ò¥HÀ³¸Ó¬Oª½±µ±µ¤U¥h¦Ó¤£¬O¥ý±µPrivate Sub worksheet_change(ByVal target As Range):'(

¨º¦pªG±q²Ä14¶µ¶}©l§Ú­n¼W¥[¦¨½Æ¼ÆªºÀx¦s®æ

¬O­n¹³²Ä17¶µªº¤è¦¡¤U¥h ¡A ¥h°µ ½Æ»s¶K¤W µM«á§ó§ï¦¨§Ú­nªºÀx¦s®æ

¨º³o¼Ëªº¸Ü¡A¦pªG¤Ó¦h·|¤£·|¦]¦¹¡A¦³®É·|µo¥Í¿ù»~?

ÁÙ¬O»¡§Ú·Q¤Ó¦h???

TOP

¦^´_ 12# appr
  1. Private Sub worksheet_change(ByVal target As Range)
  2. Set RngA = Range("A2:A4")
  3. Set RngB = Range("B2:B4")
  4. Set RngCA = Intersect(target, RngA)
  5. Set RngCS = Intersect(target, RngB)
  6. If Not RngCA Is Nothing Then
  7.    RngCA.Offset(0, 2) = RngCA.Offset(0, 2) + RngCA.Value
  8.    RngCA.Value = ""
  9. End If
  10. If Not RngCS Is Nothing Then
  11.    RngCS.Offset(0, 1) = RngCS.Offset(0, 1) - RngCS.Value
  12.    RngCS.Value = ""
  13. End If
  14. Set RngD = Range("D2:D4")
  15. Set RngE = Range("E2:E4")
  16. Set RngDE = Intersect(target, RngD)
  17. Set RngED = Intersect(target, RngE)
  18. If Not RngDE Is Nothing Then          'E2~E4=D2~D4
  19.    RngE.Value = RngD.Value
  20. End If
  21. If Not RngED Is Nothing Then          'D2~D4=E2~E4
  22.    RngD.Value = RngE.Value
  23. End If
  24. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ appr ©ó 2012-2-24 22:07 ½s¿è

¦^´_ 13# register313


ÁÂÁÂr¤jªº¤À¨É¡A§Ú¤w¸g¤j·§³£²M·¡¤F!!!¥u¬O¥»©ó¦n©_ªº·Qªk¡A·Q¦A¦h°Ý´X­Ó°ÝÃD

¨º¦pªG¬OµL½×¬O²Ä2¡A3 ¶µ ©Î¬O  14¡A15 ¶µ  ¥H¤Î18¡A20¶µ
  1. Private Sub worksheet_change(ByVal target As Range)
  2. Set RngA = Range("A2:A4")
  3. Set RngB = Range("B2:B4")
  4. Set RngCA = Intersect(target, RngA)
  5. Set RngCS = Intersect(target, RngB)
  6. If Not RngCA Is Nothing Then
  7.    RngCA.Offset(0, 2) = RngCA.Offset(0, 2) + RngCA.Value
  8.    RngCA.Value = ""
  9. End If
  10. If Not RngCS Is Nothing Then
  11.    RngCS.Offset(0, 1) = RngCS.Offset(0, 1) - RngCS.Value
  12.    RngCS.Value = ""
  13. End If
  14. Set RngD = Range("D2:D4")
  15. Set RngE = Range("E2:E4")
  16. Set RngDE = Intersect(target, RngD)
  17. Set RngED = Intersect(target, RngE)
  18. If Not RngDE Is Nothing Then          'E2~E4=D2~D4
  19. RngE.Value = RngD.Value
  20. End If
  21. If Not RngED Is Nothing Then          'D2~D4=E2~E4
  22. RngD.Value = RngE.Value
  23. End If
  24. End Sub
½Æ»s¥N½X
³o¨Ç³£¬OÄÝ©ó³s±µªº¡A ¨º¦pªG¬O¥Î¸õªº¤@¶µ ¡£A2¡AA4¡AA6¡¤ªº¬O­n«ç»ò°µ???

²Ä¤G­Ó¬O³o¾ã­Óµ{¦¡½X ¬O¥H A2ªºÀx¦s®æ ¥[¤W ¼Æ¦r µ¥©ó C2ªº ¼Æ¦r¦X
                                        ¥H¤ÎB2ªºÀx¦s®æ  ´î¤W ¼Æ¦r µ¥©ó C2ªº¼Æ¦r¦X   

¨º»ò¦pªG§Ú­n§âB2ªºÀx¦s®æ´«¦¨C2

¨º»ò ³o­Óµ{¦¡½X ©Ò¥X¨Óªºµ²ªG·|¦bD2:D4Åã¥Ü

¤£¹LA2·|Åܦ¨¡i -¡j¸¹         ¦Ó§Ú§ó°Êªº  C2 ¤]¬O¡i -¡j¸¹     ©Ò¥H¥X¨Óªºµª®×·|³£¬O­tªº  

¨º§ÚÀ³¸Ó¬O­n«ç»ò°µ·|¤ñ¸û§ó°Ê·|¤ñ¸û¦n?

¥t¥~¦pªG§Ú¬O·Q­n«ü©w¤@­ÓÀx¦s®æ ¡A§Ú¦Û¤v¦³°µ¤@­Ó§ó°Ê ¡A ÁöµM§Úª¾¹D¤@©w¬O¿ùªº¡A¦ýÁÙ¬O§Æ±æ¦U¦ì¹L¥Ø¬Ý¬Ý
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. Set RngA = Range("A2:A4")
  3. Set RngB = Range("B2:B4")
  4. Set RngC = Range("G2:G4")
  5. Set RngCA = Intersect(Target, RngA)
  6. Set RngCS = Intersect(Target, RngB)
  7. Set RngCD = Intersect(Target, RngC)
  8. If Not RngCA Is Nothing Then
  9.    RngCD.Offset(0, 2) = RngCA.Offset(0, 2) + RngCA.Value
  10.    RngCA.Value = ""
  11. End If
  12. If Not RngCS Is Nothing Then
  13.    RngCD.Offset(0, 1) = RngCS.Offset(0, 1) - RngCS.Value
  14.    RngCS.Value = ""
  15. End If
  16. End Sub
½Æ»s¥N½X

TOP

¦^´_ 14# appr


°ÝÃD¤@   Set RNG = Union([A2], [A4], [A6])
°ÝÃD¤G   ¤£¤F¸Ñ»¡©ú¤Î¥\¯à
°ÝÃD¤T    ¤£¤F¸Ñ»¡©ú¤Î¥\¯à

TOP

¥»©«³Ì«á¥Ñ appr ©ó 2012-2-24 23:42 ½s¿è

¦^´_ 15# register313

¥ý¦^µª¤T¡A¦b¦^µª¤G

   °ÝÃD¤Tªº»¡©ú¡G­ì¥»³o­Óµ{¦¡½X¤U¬O C2 ¬°³Ì«áµª®× ¡A¤]´N¬O»¡ A2 ­Y¬°10     ¨º C2¬°8   
                                                                                                                      B2 ­Y¬° 2

¨º»ò¦pªG­n§ó§ïC2ªºÀx¦s®æ¨ì G2  ¸Ó¦p¦ó«ç»ò¼g°_

¥\¯à»¡©ú¡G Åܰʳ̫ᵪ®×Àx¦s®æ

ªþµù¡G³Ì«áªºµ{¦¡½X¬O§Ú¦Û¤v·ÓµÛ¤W­±ªº·Qªk¡A¥h¸ÕµÛ¥h¥´¥X¨Óªº!!

¥u¬O¬Ý¤£½T©w¬O§_¥¿½T¡A·QÅý¤j®a¬Ý¬Ý¿ù¦b­þ?

©µÄò°ÝÃD¢²

°ÝÃD¤Gªº»¡©ú¡G    ¦pªG§âB2 ªºÀx¦s®æÅÜ°Ê ¨ì C2   ¦] °ÝÃD¢²ªºµ{¦¡½Xªº³]©w¬°  ©¹«á±À¤@­ÓÀx¦s®æ¬°µª®×¡A¬G      

­Y ¡@A2 ¬°   4          ¡@D2 ¬°   3
   ¡@ C2 ¬°   1   

¦ý§Ú¸ÕµÛ·Ó¤W­±§ó°Ê«á «oµo²{    A2¬°4ªº±¡ªp¤U      D2¬°   ¡Ð¢³
                  
                                                    ­Y§ó°Ê«áªº¢Ñ¢±¿é¤J¡@¢³¡@¡@¡@¨º¡@¡@¡@¢Ò¢±¡@¬°¡@¡@¡Ð¢³

¥\¯à¡GÅܰʤ¤¶¡ªºÀx¦s®æ

TOP

¦^´_ 16# appr

°ÝÃD3
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. Set RngA = Range("A2:A4")
  3. Set RngB = Range("B2:B4")
  4. Set RngCA = Intersect(Target, RngA)
  5. Set RngCS = Intersect(Target, RngB)
  6. If Not RngCA Is Nothing Then
  7.    RngCA.Offset(0, 6) = RngCA.Offset(0, 6) + RngCA.Value
  8.    RngCA.Value = ""
  9. End If
  10. If Not RngCS Is Nothing Then
  11.    RngCS.Offset(0, 5) = RngCS.Offset(0, 5) - RngCS.Value
  12.    RngCS.Value = ""
  13. End If
  14. End Sub
½Æ»s¥N½X

TOP

¦^´_ 17# register313


    ¤F¸Ñ!!§Ú³o¨â­Ó°ÝÃD¬O¥X¦b­þ¸Ì¤F!!!·PÁÂR¤jªº¦^ÂЭC!!

TOP

¦^´_ 17# register313

¤£¦n·N«ä¡A¤S¥X²{¦b¤F¨â­Ó°ÝÃD·Q½Ð±Ð¤@¤U¡A §Ú·Q­n¦P®ÉÅýA2¸òµÛC2¥H¤ÎG2°µ¤@¼Ëªº°Ê§@!!

¦ý¨C¦¸¥Î¦n«á ¡A§Úªºexcel´N·í±¼¤F!!!¬Oµ{¦¡½X§Ú¥´¿ù¤F¶Ü?

¥H¤Î¦pªG·QÅý G2¥i¥H¬O¦Û°Ê§P§O¤ë¥÷ !!!  ¤]´N¬O»¡ 2¤ë¥÷¬O¦bG2 ·í 3¤ë¥÷·|¦Û°Ê¸õ¨ì  H2 ³o¬O­n«ç»ò³]©w????
  1. Private Sub worksheet_change(ByVal target As Range)
  2. Set RngA = Range("A2:A4")
  3. Set RngB = Range("B2:B4")
  4. Set RngCA = Intersect(target, RngA)
  5. Set RngCS = Intersect(target, RngB)
  6. If Not RngCA Is Nothing Then
  7.    RngCA.Offset(0, 2) = RngCA.Offset(0, 2) + RngCA.Value
  8.    RngCA.Value = ""
  9. End If
  10. If Not RngCS Is Nothing Then
  11.    RngCS.Offset(0, 1) = RngCS.Offset(0, 1) - RngCS.Value
  12.    RngCS.Value = ""
  13. End If
  14. Set RngD = Range("D2:D4")
  15. Set RngE = Range("E2:E4")
  16. Set RngDE = Intersect(target, RngD)
  17. Set RngED = Intersect(target, RngE)
  18. If Not RngDE Is Nothing Then          'E2~E4=D2~D4
  19.    RngE.Value = RngD.Value
  20. End If
  21. If Not RngED Is Nothing Then          'D2~D4=E2~E4
  22.    RngD.Value = RngE.Value
  23. End If
  24. Set RngA = Range("A2:A4")
  25. Set RngCA = Intersect(target, RngA)
  26. If Not RngCA Is Nothing Then
  27.    RngCA.Offset(0, 6) = RngCA.Offset(0, 6) + RngCA.Value
  28.    RngCA.Value = ""
  29. End If
  30. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ register313 ©ó 2012-2-27 10:14 ½s¿è

¦^´_ 19# appr

¥Ø«e¥\¯à¦p¤U
1.gif
  1. Private Sub worksheet_change(ByVal target As Range)
  2. Set RngA = Range("A2:A4")
  3. Set RngB = Range("B2:B4")
  4. Set RngCA = Intersect(target, RngA)
  5. Set RngCS = Intersect(target, RngB)
  6. If Not RngCA Is Nothing Then
  7.    RngCA.Offset(0, 2) = RngCA.Offset(0, 2) + RngCA.Value
  8.    RngCA.Offset(0, 6) = RngCA.Offset(0, 6) + RngCA.Value
  9.    RngCA.Value = ""
  10. End If
  11. If Not RngCS Is Nothing Then
  12.    RngCS.Offset(0, 1) = RngCS.Offset(0, 1) - RngCS.Value
  13.    RngCS.Value = ""
  14. End If
  15. Set RngD = Range("D2:D4")
  16. Set RngE = Range("E2:E4")
  17. Set RngDE = Intersect(target, RngD)
  18. Set RngED = Intersect(target, RngE)
  19. If Not RngDE Is Nothing Then          'E2~E4=D2~D4
  20.    RngE.Value = RngD.Value
  21. End If
  22. If Not RngED Is Nothing Then          'D2~D4=E2~E4
  23.    RngD.Value = RngE.Value
  24. End If
  25. End Sub
½Æ»s¥N½X
¨ä¾l°ÝÃD¥HexcelÀɮק@¦¨½d¨Ò¦A¥[¥H»¡©ú

TOP

        ÀR«ä¦Û¦b : ¡i»X½ªªº¦Û¥Ñ¡j¤H±`¦b¤°»ò³£¥i¥H¦Û¥Ñ¦Û¦bªº®É­Ô¡A«o³Q³oºØÀH¤ß©Ò±ýªº¦Û¥Ñ»X½ª¡AµêÂY®É¥ú¦Ó²@µLıª¾¡C
ªð¦^¦Cªí ¤W¤@¥DÃD