- ©«¤l
- 28
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 32
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN 7
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-1-1
- ³Ì«áµn¿ý
- 2012-6-29
|
¥»©«³Ì«á¥Ñ 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¶µ- Private Sub worksheet_change(ByVal target As Range)
- Set RngA = Range("A2:A4")
- Set RngB = Range("B2:B4")
- Set RngCA = Intersect(target, RngA)
- Set RngCS = Intersect(target, RngB)
- If Not RngCA Is Nothing Then
- RngCA.Offset(0, 2) = RngCA.Offset(0, 2) + RngCA.Value
- RngCA.Value = ""
- End If
- If Not RngCS Is Nothing Then
- RngCS.Offset(0, 1) = RngCS.Offset(0, 1) - RngCS.Value
- RngCS.Value = ""
- End If
- Set RngD = Range("D2:D4")
- Set RngE = Range("E2:E4")
- Set RngDE = Intersect(target, RngD)
- Set RngED = Intersect(target, RngE)
- If Not RngDE Is Nothing Then 'E2~E4=D2~D4
- RngE.Value = RngD.Value
- End If
- If Not RngED Is Nothing Then 'D2~D4=E2~E4
- RngD.Value = RngE.Value
- End If
- End Sub
½Æ»s¥N½X ³o¨Ç³£¬OÄÝ©ó³s±µªº¡A ¨º¦pªG¬O¥Î¸õªº¤@¶µ ¡£A2¡AA4¡AA6¡¤ªº¬On«ç»ò°µ???
²Ä¤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¨Óªºµª®×·|³£¬Otªº
¨º§ÚÀ³¸Ó¬On«ç»ò°µ·|¤ñ¸û§ó°Ê·|¤ñ¸û¦n?
¥t¥~¦pªG§Ú¬O·Qn«ü©w¤@ÓÀx¦s®æ ¡A§Ú¦Û¤v¦³°µ¤@Ó§ó°Ê ¡A ÁöµM§Úª¾¹D¤@©w¬O¿ùªº¡A¦ýÁÙ¬O§Æ±æ¦U¦ì¹L¥Ø¬Ý¬Ý- Private Sub Worksheet_Change(ByVal Target As Range)
- Set RngA = Range("A2:A4")
- Set RngB = Range("B2:B4")
- Set RngC = Range("G2:G4")
- Set RngCA = Intersect(Target, RngA)
- Set RngCS = Intersect(Target, RngB)
- Set RngCD = Intersect(Target, RngC)
- If Not RngCA Is Nothing Then
- RngCD.Offset(0, 2) = RngCA.Offset(0, 2) + RngCA.Value
- RngCA.Value = ""
- End If
- If Not RngCS Is Nothing Then
- RngCD.Offset(0, 1) = RngCS.Offset(0, 1) - RngCS.Value
- RngCS.Value = ""
- End If
- End Sub
½Æ»s¥N½X |
|