- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 257
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-28
|
¦^´_ 25# 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], .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
½Æ»s¥N½X |
|