|
- Sub 按钮2_Click()
- Application.ScreenUpdating = False
- Set d = CreateObject("scripting.dictionary")
- arr = Sheets("库存信息").UsedRange
- For j = 2 To UBound(arr)
- d(arr(j, 2) & arr(j, 5)) = j
- Next j
- r = UBound(arr) + 1
- arr = Sheets("入库管理").UsedRange
- With Sheets("库存信息")
- For j = 2 To UBound(arr)
- If arr(j, 2) <> "已入库" Then
- arr(j, 2) = "已入库"
- If d.exists(arr(j, 3) & arr(j, 6)) Then
- .Cells(d(arr(j, 3) & arr(j, 6)), 6) = arr(j, 7) + .Cells(d(arr(j, 3) & arr(j, 6)), 6)
- Else
- Cells(j, 3).Resize(1, 6).Copy .Cells(r, 2)
- d(arr(j, 3) & arr(j, 6)) = r
- .Cells(r, 1) = r - 1
- r = r + 1
- End If
- End If
- Next j
- End With
- Sheets("入库管理").UsedRange = arr
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|