|
- Sub yy()
- Dim D1 As New Dictionary
- Dim D2 As New Dictionary
- Dim D As New Dictionary
- Dim Arr, i&, x$, Brr, c, a, xx$
- Dim Sht1 As Worksheet, Sht As Worksheet
- Dim k, t, k1, t1, k2, t2, yk, sk, qk, jb, tb
- Sheet1.Activate
- For Each Sht In Sheets
- If Sht.Name <> "分析" And Sht.Name <> "参数" Then
- Arr = Sht.[a1].CurrentRegion
- yk = yk + 1
- For i = 2 To UBound(Arr)
- x = Arr(i, 2)
- D(x) = ""
- xx = Sht.Name
- If D1.Exists(x) = False Then Set D1(x) = New Dictionary
- D1(x)(xx) = Arr(i, 4) '总分
- If D2.Exists(x) = False Then Set D2(x) = New Dictionary
- D2(x)(xx) = Arr(i, 6) '年排名
- Next
- End If
- Next
- k = D.keys
- ReDim Brr(1 To D.Count, 1 To 62)
- For i = 0 To UBound(k)
- jb = 0: tb = 0
- Set r1 = Sheets("10").[b:b].Find(k(i), , , 1)
- If Not r1 Is Nothing Then Brr(i + 1, 1) = Sheets("10").Cells(r1.Row, 1)
- Brr(i + 1, 2) = k(i)
- k1 = D1(k(i)).keys: k2 = D2(k(i)).keys
- t1 = D1(k(i)).items: t2 = D2(k(i)).items
- sk = UBound(t1) + 1: qk = yk - sk
- Brr(i + 1, 8) = yk: Brr(i + 1, 9) = sk: Brr(i + 1, 10) = qk
- For j = 0 To UBound(k1)
- c = Val(k1(j)) + 46
- Brr(i + 1, c) = t1(j)
- Select Case t1(j)
- Case 555 To 600
- Brr(i + 1, 57) = Brr(i + 1, 57) + 1
- Case 525 To 555
- Brr(i + 1, 58) = Brr(i + 1, 58) + 1
- Case 500 To 525
- Brr(i + 1, 59) = Brr(i + 1, 59) + 1
- Case 480 To 500
- Brr(i + 1, 60) = Brr(i + 1, 60) + 1
- Case 450 To 480
- Brr(i + 1, 61) = Brr(i + 1, 61) + 1
- Case Is < 450
- Brr(i + 1, 62) = Brr(i + 1, 62) + 1
- End Select
- Next
- For j = 0 To UBound(k2)
- c = Val(k2(j)) + 22
- Brr(i + 1, c) = t2(j)
- Select Case t2(j)
- Case 1 To 100
- Brr(i + 1, 33) = Brr(i + 1, 33) + 1
- Case 101 To 150
- Brr(i + 1, 34) = Brr(i + 1, 34) + 1
- Case 151 To 200
- Brr(i + 1, 35) = Brr(i + 1, 35) + 1
- Case 201 To 240
- Brr(i + 1, 36) = Brr(i + 1, 36) + 1
- Case 241 To 320
- Brr(i + 1, 37) = Brr(i + 1, 37) + 1
- Case 321 To 400
- Brr(i + 1, 38) = Brr(i + 1, 38) + 1
- Case 401 To 450
- Brr(i + 1, 39) = Brr(i + 1, 39) + 1
- Case Is > 450
- Brr(i + 1, 40) = Brr(i + 1, 40) + 1
- End Select
- Select Case t2(j)
- Case 1 To 160
- Brr(i + 1, 41) = Brr(i + 1, 41) + 1
- Case 161 To 208
- Brr(i + 1, 42) = Brr(i + 1, 42) + 1
- Case 209 To 240
- Brr(i + 1, 43) = Brr(i + 1, 43) + 1
- Case 241 To 320
- Brr(i + 1, 44) = Brr(i + 1, 44) + 1
- Case 321 To 400
- Brr(i + 1, 45) = Brr(i + 1, 45) + 1
- Case Is > 400
- Brr(i + 1, 46) = Brr(i + 1, 46) + 1
- End Select
- Next
- For j = 1 To UBound(t2)
- a = t2(j) - t2(j - 1)
- If a < 0 Then
- jb = jb + 1
- Brr(i + 1, 13 + j) = "↑" & -a
- Else
- tb = tb + 1
- Brr(i + 1, 13 + j) = "↓" & a
- End If
- Next
- Brr(i + 1, 11) = jb
- Brr(i + 1, 12) = tb
- Next
- [a5].Resize(UBound(Brr), 62) = Brr
- [a5].Resize(UBound(Brr), 62).Sort [AF5], 1
- End Sub
复制代码 |
|