- ©«¤l
- 913
- ¥DÃD
- 150
- ºëµØ
- 0
- ¿n¤À
- 1089
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2011-8-28
- ³Ì«áµn¿ý
- 2023-7-19
|
¦^´_ 36# samwang
Sam±z¦n,
§Ú±N²Îp§ï¬°IÄæ,¤Sµo²{Ãþ¦ü°ÝÃD,
¤W¦^¬O³Ì¥½¤@¦C³æ¸¹ªÅ¥Õ®É,µLªk²Îp¼Æ¶q
³o¦¸¬O³Ì¥½¤@¦C,µLªk²Îp¼Æ¶q
¤¤°Ï_¦h¦~«×.rar (87.81 KB)
- Sub test()
- Dim Arr, Brr, xD, i&, T$, T1$
- Arr = Sheets("«n°Ï").Range("a3:k" & [¤¤°Ï!a65536].End(3).Row + 1)
- ReDim Brr(1 To UBound(Arr), 1 To 1)
- Set xD = CreateObject("Scripting.Dictionary")
- For i = 1 To UBound(Arr)
- If Not IsDate(Arr(i, 1)) Then GoTo 98
- T = Year(Arr(i, 1)) & "|" & Month(Arr(i, 1)): T1 = Year(Arr(i, 1)) & "|" & Month(Arr(i + 1, 1))
- If xD.Exists(T) Then
- If T <> T1 Then
- xD(Arr(i, 1)) = Val(xD(T)) + Val(Arr(i, 4))
- Else
- xD(T) = Val(xD(T)) + Val(Arr(i, 4))
- End If
- Else
- xD(T) = Val(Arr(i, 4))
- End If
- 98: Next
- For Each ky In xD.keys
- For i = 1 To UBound(Arr)
- If Not IsDate(Arr(i, 1)) Then GoTo 99
- T = Year(Arr(i, 1)) & "|" & Month(Arr(i, 1)): T1 = Year(Arr(i, 1)) & "|" & Month(Arr(i + 1, 1))
- If T <> T1 Then Brr(i, 1) = xD(Arr(i, 1))
- 99: Next
- Next
- Sheets("«n°Ï").[i3].Resize(UBound(Brr)) = Brr
- End Sub
½Æ»s¥N½X |
|