|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 xutianlin 于 2014-2-12 22:34 编辑
Sub 第一次()
Dim j As Integer, i As Integer, arr
On Error Resume Next
Set d = CreateObject("scripting.dictionary")
j = Sheet1.Range("a65536").End(xlUp).Row
arr = Sheet1.Range("a1:b" & j)
For i = 1 To UBound(arr)
d.Add arr(i, 1), arr(i, 2)
Next
Sheet2.Range("a1").Resize(d.Count, 1) = Application.WorksheetFunction.Transpose(d.keys)
Sheet2.Range("b1").Resize(d.Count, 1) = Application.WorksheetFunction.Transpose(d.items)
End Sub |
|