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

¦p¦ó¥h§äÂ÷¦Û¤v³Ìªñªº­È?

¦^´_ 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

TOP

¦^´_ 21# ÂŤÑÄR¦À


¤W¶ÇÀɮ׬ݬÝ~~

TOP

¥»©«³Ì«á¥Ñ ÂŤÑÄR¦À ©ó 2024-2-15 21:40 ½s¿è

¦^´_ 22# ­ã´£³¡ªL

TEST.rar (806.63 KB) ³o­Ó
§Ú¦Û¤v²q·Q¬O¸Ì­±¦h­Ó°}¦C¬Û¥[´îªº­ì¦]¡A¬O¤£¬O­n±N°}¦C¤À¶}¨Ó¬Û¥[´î¤~¤£·|¥X²{¿ù»~¡A§Ú¥t¤@­ÓÀɮקâ¦o©î¶}´N¨S¨Æ¡A¦ý¬O¤£¥ÎVBAªº¤è¦¡ª½±µ¥´¦bÀx¦s®æ¤W«o¥i¥H¡A§Ú´Nı±o¦³ÂI©_©Ç¤F

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2024-2-17 11:47 ½s¿è

¦^´_ 23# ÂŤÑÄR¦À


ÀÉ®×´ú¤£¤F//
¥i¥Î¥t¤@¤è¦¡:§Q¥Î¤@Àx¦s®æ(¨Ò¦p:V4)¿é¤J°}¦C¤½¦¡, °õ¦æ®É¥ÎV4¥hCOPY
    If Not Intersect(Target, [B5:B210000]) Is Nothing Then
       Range("V4").Copy Range("V" & Target.Row)

TOP

¦^´_ 24# ­ã´£³¡ªL


   §Ú¦A¸Õ¸Õ¬Ý

TOP

        ÀR«ä¦Û¦b : ¤H­n¦Û·R¡A¤~¯à·R´¶¤Ñ¤Uªº¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD