|
- Sub DoDict()
- Dim d As Object
- Dim arr, brr, i&, s$
- Set d = CreateObject("scripting.dictionary")
- arr = Sheets("拆零商品明细").[a1].CurrentRegion
- For i = 2 To UBound(arr)
- s = arr(i, 1)
- d(s) = arr(i, 9)
- Next
- brr = Sheets("库存查询").[a1].CurrentRegion
- ReDim arr(1 To UBound(brr), 1 To 1)
- For i = 2 To UBound(brr)
- s = brr(i, 2)
- If d.exists(s) Then
- arr(i, 1) = d(s)
- Else
- arr(i, 1) = ""
- End If
- Next
- arr(1, 1) = "件装数"
- Sheets("库存查询").[q1].Resize(UBound(arr), 1) = arr
- Set d = Nothing
- MsgBox "查询ok"
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|