| ©«¤l4901 ¥DÃD44 ºëµØ24 ¿n¤À4916 ÂI¦W267  §@·~¨t²ÎWindows 7 ³nÅ骩¥»Office 20xx ¾\ŪÅv150 ©Ê§O¨k ¨Ó¦Û¥x¥_ µù¥U®É¶¡2010-4-30 ³Ì«áµn¿ý2025-10-31 
                
 | 
                
| ¦^´_ 1# mmggmm ½Æ»s¥N½XPrivate Sub Worksheet_Change(ByVal Target As Range) '¤ëµ²
If Intersect(Target, Union([A1], [C1])) Is Nothing Then Exit Sub
Set d = CreateObject("Scripting.Dictionary")
MyDay = [A1] & [C1]
With Sheets("Main")
For Each a In .Range(.[A2], .[A2].End(xlDown))
   If Format(a, "yyyym") = MyDay Then
     If IsEmpty(d(a.Offset(, 1).Value)) Then
        d(a.Offset(, 1).Value) = Array(a.Offset(, 1).Value, a.Offset(, 2).Value, a.Offset(, 3).Value, a.Offset(, 4).Value)
        Else
        ar = d(a.Offset(, 1).Value)
        ar(2) = ar(2) + a.Offset(, 3): ar(3) = ar(3) + a.Offset(, 4)
        d(a.Offset(, 1).Value) = ar
        Erase ar
     End If
    End If
 Next
 Me.Range("A1").CurrentRegion.Offset(3).ClearContents
 If d.Count > 0 Then Me.[A3].Resize(d.Count, 4) = Application.Transpose(Application.Transpose(d.items))
 End With
End Sub
½Æ»s¥N½XPrivate Sub Worksheet_Change(ByVal Target As Range) '¦~µ²
If Intersect(Target, [A1]) Is Nothing Then Exit Sub
Set d = CreateObject("Scripting.Dictionary")
MyYear = [A1]
With Sheets("Main")
For Each a In .Range(.[A2], .[A2].End(xlDown))
   If Year(a) = MyYear Then
     If IsEmpty(d(a.Offset(, 1).Value)) Then
        d(a.Offset(, 1).Value) = Array(a.Offset(, 1).Value, a.Offset(, 2).Value, a.Offset(, 3).Value, a.Offset(, 4).Value)
        Else
        ar = d(a.Offset(, 1).Value)
        ar(2) = ar(2) + a.Offset(, 3): ar(3) = ar(3) + a.Offset(, 4)
        d(a.Offset(, 1).Value) = ar
        Erase ar
     End If
    End If
 Next
 Me.Range("A1").CurrentRegion.Offset(3).ClearContents
 If d.Count > 0 Then Me.[A3].Resize(d.Count, 4) = Application.Transpose(Application.Transpose(d.items))
 End With
End Sub
 | 
 |