- ©«¤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
|
¥»©«³Ì«á¥Ñ samwang ©ó 2022-7-29 20:27 ½s¿è
¦^´_ 3# BV7BW
1)³æ¶µ¥Ø¬d¸ß.¥Dn¬d¸ß4/1¦Ü4/10¤é³æ¤@¶µ¥Ø©Ò¦³¾P°â¥X¼Æ¶q.¤Îþ´X«È¤á©Ò¶R¦h¤Ö§e¦C
¦p¤U½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
Sub ³æ¶µ¥Ø¬d¸ß()
Dim Arr, xD, T$, Ds As Date, De As Date
Dim Brr(1 To 1, 1 To 4), Crr(), n%, i&, j%
Set xD = CreateObject("Scripting.Dictionary")
Ds = [K5]: De = [K6]: T = [K9]
Arr = Sheets("q³f©ú²Óªí").[a1].CurrentRegion
ReDim Crr(1 To UBound(Arr), 1 To 5)
For i = 2 To UBound(Arr)
If Arr(i, 4) <> T Then GoTo 99
If Arr(i, 12) >= Ds And Arr(i, 12) <= De Then
If n = 0 Then
n = n + 1: xD(Arr(i, 1) & "") = n
For j = 1 To 4: Brr(1, j) = Arr(i, j + 2): Next
Crr(n, 1) = Arr(i, 1): Crr(n, 2) = Arr(i, 3)
Crr(n, 3) = Arr(i, 4): Crr(n, 4) = Arr(i, 5)
Crr(n, 5) = Arr(i, 6)
Else
If xD.Exists(Arr(i, 1) & "") Then
m = xD(Arr(i, 1) & "")
Crr(m, 4) = Arr(i, 5) + Crr(m, 4)
Else
n = n + 1: xD(Arr(i, 1) & "") = n
Crr(n, 1) = Arr(i, 1): Crr(n, 2) = Arr(i, 3)
Crr(n, 3) = Arr(i, 4): Crr(n, 4) = Arr(i, 5)
Crr(n, 5) = Arr(i, 6)
End If
Brr(1, 3) = Brr(1, 3) + Arr(i, 5)
End If
End If
99: Next
If n > 0 Then
Range("a2:c2") = ""
Range("a2").Resize(1, 4) = Brr
Range("r2:v8") = ""
Range("r2").Resize(n, 5) = Crr
End If
End Sub
|
|