- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 277
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-12-23
|
¦^´_ 15# luke - Sub 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], .[A10].End(xlDown))
- 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)
- For Each A In .Range(.[A2], .[A2].End(xlDown))
- A.Offset(, 3) = A.Offset(, 2) + d(i & "," & A & "," & A.Offset(, 1))
- d.Remove i & "," & A & "," & A.Offset(, 1)
- Next
- End With
- Next
- For Each ky In d.keys
- ar = Split(ky, ",")
- With Sheets(CInt(ar(0)))
- Set A = .[A1].End(xlDown).Offset(1, 0)
- A = ar(1): A.Offset(, 1) = ar(2): A.Offset(, 3) = d(ky)
- End With
- Next
- End Sub
½Æ»s¥N½X |
|