|
- Sub lqxs()
- Dim Arr, i&, x, y$, k1, j&, Brr
- Dim d, k, t, d1
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- [m:z].Clear
- Arr = Sheet1.UsedRange
- For j = 1 To UBound(Arr, 2)
- x = Arr(2, j)
- If d.exists(x) = False Then Set d(x) = CreateObject("Scripting.Dictionary")
- For i = 3 To UBound(Arr)
- y = Arr(i, j)
- If y <> "" Then
- d(x)(y) = 1
- d1(y) = ""
- End If
- Next
- Next
- k = d.keys: t = d.items: k1 = d1.keys
- [n2].Resize(1, d.Count) = k
- [m3].Resize(d1.Count) = Application.Transpose(k1)
- Brr = [m2].CurrentRegion
- For j = 2 To UBound(Brr, 2)
- x = Brr(1, j)
- For i = 2 To UBound(Brr)
- y = Brr(i, 1)
- If d(x).exists(y) Then Brr(i, j) = d(x)(y)
- Next
- Next
- [m2].CurrentRegion = Brr
- [m2].CurrentRegion.Sort [m3], 1, Header:=xlYes
- [m2].CurrentRegion.Borders.LineStyle = 1
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|