- ©«¤l
- 199
- ¥DÃD
- 22
- ºëµØ
- 0
- ¿n¤À
- 233
- ÂI¦W
- 231
- §@·~¨t²Î
- Vista
- ³nÅ骩¥»
- Office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- °ª¶¯
- µù¥U®É¶¡
- 2020-4-14
- ³Ì«áµn¿ý
- 2024-11-30
|
¦^´_ 2# samwang
samwang ¦Ñ®v §A¦n
¸g´ú¸Õ¤w«D±`¥¿½T²Å¦X»Ý¨D.®w¦s¸ê®Æ¤]¥¿½Tµn¿ý
ÁÂÁ samwang ¦Ñ®v «ü¾É
®w¦s³¡¤À¬O§_¦b¤W´£¤å¤¤×§ï
Sub ³æ¶µ¥Ø¬d¸ß()
'µ{¦¡¸ê®Æ¨Ó·½¦Üsanwanq2022-7-29 «ü¾É
Dim Arr, xD, T$, Ds As Date, De As Date
Dim Brr(1 To 1, 1 To 4), Crr(), n%, i&, j%
Range("R2:V12").Select
Selection.ClearContents
Range("A2:E1500").Select
Selection.ClearContents
Range("Q2:V300").Select
Selection.ClearContents
'Range("O2:O100").Select
'Selection.ClearContents
Range("K7").Select
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
With ActiveSheet
Beep
End With
End Sub |
|