- ©«¤l
- 678
- ¥DÃD
- 147
- ºëµØ
- 0
- ¿n¤À
- 799
- ÂI¦W
- 0
- §@·~¨t²Î
- win 8
- ³nÅ骩¥»
- MS 2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2016-2-9
- ³Ì«áµn¿ý
- 2022-1-20
|
¥»©«³Ì«á¥Ñ ziv976688 ©ó 2021-8-22 10:40 ½s¿è
¦^´_ 10# samwang
·PÁ±zªº«ü¾É^^
TEST_0822_s1.rar (24.92 KB)
¤£¦n·N«ä¡A"·s¼W»Ý¨D"ªºµ{¦¡½X~§Ú©ñ¸mªº¦ì¦C~¤£ª¾¹D¬Oþ¸Ì¦³»~¸m?
©Ò¥H¦b¦C47·|²£¥Í°»¿ù^^"
If Arr(i, 3) > 0 Then Arr(i, 4) = Arr(i, 3) / Arr(i, 2)
©|½Ð³Ò¾r±z½ç¥¿¡CÁÂÁ±z!
Private Sub CommandButton1_Click()
Dim Arr, Brr(1 To 7), Crr, xD, T%, i&, j&
Nrange = "1878" ' InputBox("½Ð¿é¤JDATA!ªº¶}¼ú´Á¼Æ", "¿é¤J´Á¼Æ")
Tm = Timer
[L1] = ""
Application.DisplayAlerts = False
Set xD = CreateObject("Scripting.Dictionary")
With Sheets("Sheet1")
.[A1] = Nrange
T = .[A1]
Arr = Range([DATA!h1], [DATA!a65536].End(3))
For i = 2 To UBound(Arr)
If Arr(i, 1) = T Then
For j = 2 To 8: n = n + 1: Brr(n) = Arr(i, j): Next
End If
Next
.[A2] = ((.Cells(1, 256).End(xlToLeft).Column - 12) / 2) & "Ó"
.[A3] = "¶}¼ú¸¹½X"
.[A4].Resize(7) = Application.Transpose(Brr)
For i = 1 To 49 'BÄæ
.Range("B" & i + 1) = i
Next
R = .Columns("M:DF").Find("*", , , , , 2).Row
Arr = .Range("M1:DF" & R)
For j = 1 To UBound(Arr, 2) Step 2
For i = 2 To UBound(Arr)
T = Arr(i, j): If T = 0 Then GoTo 98
xD(T & "/1") = xD(T & "/1") + 1
xD(T & "/2") = xD(T & "/2") + Arr(i, j + 1)
Next i
98: Next j
Arr = .Range(.[C1], .[B65536].End(3))
For i = 2 To UBound(Arr)
For j = 1 To 2: Arr(i - 1, j) = xD(Arr(i, 1) & "/" & j): Next
If xD(Arr(i, 1) & "/1") = "" Then Arr(i - 1, 1) = 0: Arr(i - 1, 2) = 0 'n·s¼W
Next
.[C2].Resize(UBound(Arr) - 1, 2) = Arr 'C&DÄæ
Arr = .Range(.[B2], .[e65536].End(3))
ReDim Crr(1 To UBound(Arr), 1 To 5)
For i = 1 To UBound(Arr)
If Arr(i, 3) > 0 Then Arr(i, 4) = Arr(i, 3) / Arr(i, 2)
Crr(i, 1) = Arr(i, 2): Crr(i, 2) = Arr(i, 2)
Crr(i, 3) = Arr(i, 1): Crr(i, 4) = Arr(i, 3)
Crr(i, 5) = Arr(i, 4)
Next
.[B2].Resize(UBound(Arr), 4) = Arr
With .Range("g2").Resize(UBound(Crr), 5)
.Value = Crr
.Sort key1:=.Item(1), Order1:=2, Header:=xlNo
Crr = .Value
End With
T = Application.Max(.Range("g2:g" & UBound(Crr)))
For i = 1 To UBound(Crr)
Crr(i, 1) = T - Crr(i, 1) + 1
Next
.[H2].Resize(UBound(Crr), 1) = Crr
'ª©±®æ¦¡.........................................................
With .Columns("A:DF")
.Font.Name = "Verdana" '¦rÅé
.HorizontalAlignment = xlCenter '¥ª¥k¸m¤¤
.VerticalAlignment = xlCenter '¤W¤U¸m¤¤
.EntireColumn.AutoFit '¦Û°ÊÄæ¼e
.EntireRow.AutoFit '¦Û°Ê¦C°ª
End With
End With
Sheets("Sheet1").Copy
ActiveWorkbook.SaveAs ThisWorkbook.Path & "\7C_0_" & Nrange & "´Á_" & Sheets("Sheet1").[A2] & ".xls"
ActiveWindow.Close
Application.Goto [DATA!J1]
[L1] = Nrange & "=" & Format((Timer - Tm) / 24 / 60 / 60, "hh:mm:ss")
End Sub |
|