- ©«¤l
- 976
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 1018
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-4-19
- ³Ì«áµn¿ý
- 2024-10-30
|
¦^´_ 35# PJChen
1) AÄæ¨C¤ë²Ä¤@µ§¤é´Á,¤£¤@©w1¤é¶}©l
2) AÄæ¨C¤ë³Ì«á¤@µ§¤]¤£¤@©w¬O¤ë©³¤é,¥un¬O¨C¤ëªº³Ì«á¥X²{ªº¤é´Á´N¶i¦æ²Îp
3) n§â¦~«×¤]¦Ò¶q¶i¥h,¦]¬°¸ê®Æ·|¤£Â_¼W¥[,¤£·|¥u¦³¤@Ó¦~«×
4) CÄ檺³æ¸¹,·|¦³¦P¤@¤é´Á,¦P¤@³æ¸¹«½Æ¼Æ¦¸,§Ú·Qµ{¦¡¤¤À³¸Ó¤£¥Î¥[¤WCÄ檺§P§O,¦]¬°³æ¸¹»P²ÎpµLÃö
>> ±z¯uªº«Ü¥Î¤ß§â©Ò¦³³W«h±ø¥ó¦C¥X¡A35#¦³¤p°ÝÃD§Úקï«á¦p¤U¡A½Ð¦A´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
Sub test2()
Dim Arr, Brr, xD, i&, T$, T1$
Arr = Sheets("¤¤°Ï").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("¤¤°Ï").[h3].Resize(UBound(Brr)) = Brr
End Sub
|
|