|
- Sub aa()
- Dim A '消费数组
- Dim B '资料数组
- Dim d As Object, i As Integer
- Set d = CreateObject("scripting.dictionary")
- B = Sheets("资料").Range("a1").CurrentRegion
- '建立
- For i = 2 To UBound(B)
- d(B(i, 1)) = B(i, 3)
- Next
- With Sheets("消费")
- '查询
- A = .Range("a1").CurrentRegion
- For i = 2 To UBound(A)
- If d.exists(A(i, 1)) Then A(i, 3) = d(A(i, 1))
- Next
- '输出
- .Range("c2:c65536").ClearContents
- .Range("a1").Resize(UBound(A), UBound(A, 2)) = A
- End With
- End Sub
复制代码
Book1b.rar
(13.35 KB, 下载次数: 18)
|
|