- ©«¤l
- 365
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 406
- ÂI¦W
- 0
- §@·~¨t²Î
- Win 7
- ³nÅ骩¥»
- OFFICE 2003
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2012-12-11
- ³Ì«áµn¿ý
- 2024-8-24
|
¦^´_ 19# ã´£³¡ªL
ã¤j¸ò§A½Ð±Ð¤@¤U¡A¤W¦¸§Ú®Ú¾Ú§A±Ð§Úªº²Ä3ÂI¥h¿ý»s¡A¤§«á°õ¦æµ{¦¡¡A¥X²{"µLªk³]©wºØÃþrangeªºformulaArrayÄÝ©Ê"ªº¿ù»~°T®§¡A¥H¤U¬O§Úªºµ{¦¡½X¡A¬O¦³þÃä¥X¿ù¶Ü?(¥X²{¿ù»~ªº¦a¤è¦bRange("V" & Target.Row).FormulaArray³oÃä)
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, [B5:B210000]) Is Nothing Then
Range("V" & Target.Row).FormulaArray = "=IF(AND(RC[-20]=R[-1]C[-20],RC[-19]=R[-1]C[-19],RC[-18]=R[-1]C[-18],RC[-17]=R[-1]C[-17],RC[-16]=R[-1]C[-16]),RC[-10]-R[-1]C[-10]+RC[-9]-R[-1]C[-9]+RC[-8]-R[-1]C[-8]+RC[-7]-R[-1]C[-7]+RC[-6]-R[-1]C[-6],IF(OR(R4C2:R[-1]C6=RC[-20]),RC[-10]-MOD(MAX((R4C2:R[-1]C6=RC[-20])*(ROW(R1C1:R[-4]C1)*10^5+R4C12:R[-1]C16)),10^5),0)+IF(OR(R4C2:R[-1]C6=RC[-19]),RC[-9]-MOD(MAX((R4C2:R[-1]C6=RC[-19])*(ROW(R1C1:R[-4]C1)*10^5+R4C12:R[-1]C16)),10^5),0)+IF(OR(R4C2:R[-1]C6=RC[-18]),RC[-8]-MOD(MAX((R4C2:R[-1]C6=RC[-18])*(ROW(R1C1:R[-4]C1)*10^5+R4C12:R[-1]C16)),10^5),0)+IF(OR(R4C2:R[-1]C6=RC[-17]),RC[-7]-MOD(MAX((R4C2:R[-1]C6=RC[-17])*(ROW(R1C1:R[-4]C1)*10^5+R4C12:R[-1]C16)),10^5),0)+IF(OR(R4C2:R[-1]C6=RC[-16]),RC[-6]-MOD(MAX((R4C2:R[-1]C6=RC[-16])*(ROW(R1C1:R[-4]C1)*10^5+R4C12:R[-1]C16)),10^5),0))"
ElseIf Not Intersect(Target, [C5:C210000]) Is Nothing Then
Range("W" & Target.Row).FormulaArray = "=IF(AND(RC[-16]=R[-1]C[-16],RC[-15]=R[-1]C[-15],RC[-14]=R[-1]C[-14],RC[-13]=R[-1]C[-13],RC[-12]=R[-1]C[-12]),RC[-6]-R[-1]C[-6]+RC[-5]-R[-1]C[-5]+RC[-4]-R[-1]C[-4]+RC[-3]-R[-1]C[-3]+RC[-2]-R[-1]C[-2],IF(OR(R4C7:R[-1]C11=RC[-16]),RC[-6]-MOD(MAX((R4C7:R[-1]C11=RC[-16])*(ROW(R1C1:R[-4]C1)*10^5+R4C17:R[-1]C21)),10^5),0)+IF(OR(R4C7:R[-1]C11=RC[-15]),RC[-5]-MOD(MAX((R4C7:R[-1]C11=RC[-15])*(ROW(R1C1:R[-4]C1)*10^5+R4C17:R[-1]C21)),10^5),0)+IF(OR(R4C7:R[-1]C11=RC[-14]),RC[-4]-MOD(MAX((R4C7:R[-1]C11=RC[-14])*(ROW(R1C1:R[-4]C1)*10^5+R4C17:R[-1]C21)),10^5),0)+IF(OR(R4C7:R[-1]C11=RC[-13]),RC[-3]-MOD(MAX((R4C7:R[-1]C11=RC[-13])*(ROW(R1C1:R[-4]C1)*10^5+R4C17:R[-1]C21)),10^5),0)+IF(OR(R4C7:R[-1]C11=RC[-12]),RC[-2]-MOD(MAX((R4C7:R[-1]C11=RC[-12])*(ROW(R1C1:R[-4]C1)*10^5+R4C17:R[-1]C21)),10^5),0))"
End If
Application.EnableEvents = True
End Sub |
|