- ©«¤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-5-17 11:15 ½s¿è
¦^´_ samwang
¥ý¶i§A¦n
§Ú±N¤u§@ªí01ªºI5:I1005¶ñ¤J¸ê®Æ1¸U¦C¸ê®Æ,°õ¦æ¨S¦h¤[´NÅã¥Ü"¨S¦^À³",§Ú ...
oak0723-1 µoªí©ó 2022-5-17 09:12
¤w§ó·s¡A4¸U¦hµ§¬ù12¬í¡AÀɮפӤj66M¤£¤W¶Ç¡A½Ð¦Û¦æ«Ø¸ê®Æ«á¦A´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
¥t¥~¡A¥Î§Aªº#11ªþ¥óÀÉ®×¥h°õ¦æ·|¶]«Ü¤[(·í±¼)¡A««Ø¸ê®Æ¼Æ¾Ú¡A«Øij¼ÆÈÂରȤ£n®Ø½uµM«á¦A°õ¦æµ{¦¡(¦p¹Ï¤ù)
Sub test()
Dim Ar_in, Arr, Arr1, Brr(), Crr(), xD, T, T1, n&, i&, j&, R&, sh%, MaxR&
Set xD = CreateObject("Scripting.Dictionary")
Tm = Timer
Ar_in = Sheets("¿é¤J").Range("i3:in3")
For sh = 2 To Sheets.Count
With Sheets(sh)
.Range("i3").Resize(1, UBound(Ar_in, 2)) = Ar_in
R = .[b65536].End(3).Row: If R < 2 Then GoTo 95
Arr1 = .Range("b4:b" & R): Arr = .Range("i3:in" & R)
ReDim Brr(1 To UBound(Arr), 1 To UBound(Arr, 2)) 'IT3:RY
ReDim Preserve Crr(1 To 100000, 1 To sh - 1) '¿é¤Jªº²Îp
If MaxR < UBound(Arr) Then MaxR = UBound(Arr)
Crr(1, sh - 1) = .Name
For i = 3 To UBound(Arr)
For j = 1 To UBound(Arr, 2)
T = Arr(i, j): T1 = Arr(1, j)
If T1 = "" Then GoTo 90
If T1 = T Then
Brr(i - 2, j) = 1: n = n + 1
Else
Brr(i - 2, j) = 0
End If
90: Next j
Crr(i - 1, sh - 1) = n: n = 0
95: Next i
.[it5].Resize(UBound(Brr), UBound(Brr, 2)) = Brr
End With
Next
n = 0
With Sheets(1)
.[i4:r4].NumberFormatLocal = "@"
.[i4].Resize(MaxR, UBound(Crr, 2)) = Crr
With .[s5].Resize(MaxR - 2)
.Formula = "=Sum(i5:r5)": .Value = .Value
End With
With Range([s5], [s4].End(4))
Arr = .Value
.Sort Key1:=.Item(1), Order1:=2, Header:=2
Brr = .Value: .Value = Arr
End With
For i = 1 To UBound(Brr)
T = Brr(i, 1): If Not xD.Exists(T) Then n = n + 1: xD(T) = n
Next
For i = 1 To UBound(Arr): Arr(i, 1) = xD(Arr(i, 1)): Next
.[t5].Resize(UBound(Arr)) = Arr
End With
MsgBox Timer - Tm
End Sub
|
|