|
excel010 发表于 2012-8-23 18:16
老师················· - Sub test()
- Dim d As Object
- Dim x&, y&
- Dim arr, brr
- Set d = CreateObject("Scripting.Dictionary")
- For x = 5 To Cells(Rows.Count, "k").End(3).Row
- d(Cells(x, "k").Value) = Cells(x, "l").Resize(1, 7)
-
- Next
- For x = 5 To Cells(Rows.Count, "ah").End(3).Row
- d(Cells(x, "ah").Value) = Cells(x, "ai").Resize(1, 7)
- Next
- arr = d.keys
- brr = d.items
- For x = 0 To UBound(arr)
- Cells(5 + x, "k") = arr(x)
- For y = 1 To 7
- Cells(5 + x, "k").Offset(0, y) = brr(x)(1, y)
- Next
- Next
- Set d = Nothing
- End Sub
复制代码 |
|