| ©«¤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 
                
 | 
                
| ¦^´_ 25# luke ½Æ»s¥N½XSub ex()
Dim Mystr$, A As Range
Set d = CreateObject("Scripting.Dictionary")
With sheet1
For Each sp In .Shapes
If sp.Name Like "Check*" Then
  If sp.OLEFormat.Object.Value = 1 Then Mystr = Mystr & "," & sp.OLEFormat.Object.Caption
End If
Next
For Each A In .Range(.[A10], .Cells(.Rows.Count, 1).End(xlUp))  ³oÃäCells(.Rows.Count, 2)§ï¦¨Cells(.Rows.Count, 1)
k = Asc(A.Offset(, 5)) - 63
  If InStr(Mystr, A) > 0 Then
    d(k & "," & A.Offset(, 1) & "," & A.Offset(, 2)) = d(k & "," & A.Offset(, 1) & "," & A.Offset(, 2)) + A.Offset(, 3)
  End If
Next
End With
For i = 2 To 4
With Sheets(i)
If Application.CountA(.Columns("A")) > 0 Then
For Each A In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp))
   A.Offset(, 3) = A.Offset(, 2) + d(i & "," & A & "," & A.Offset(, 1))
   d.Remove i & "," & A & "," & A.Offset(, 1)
Next
End If
End With
Next
For Each ky In d.keys
ar = Split(ky, ",")
With Sheets(CInt(ar(0)))
Set A = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
A = ar(1): A.Offset(, 1) = ar(2): A.Offset(, 3) = d(ky)
End With
Next
End Sub
 | 
 |