|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
同一种厚度有两种材质名称,这在实际中无法正向对应,只能反向对应。- Sub updata_参数表()
- Dim arr, i&, j&, key$
- Dim dic As Object
- Set dic = CreateObject("scripting.dictionary")
- arr = Sheets("电子锯开料单").UsedRange
- For i = 4 To UBound(arr)
- dic(arr(i, 11)) = arr(i, 7)
- Next i
- With Sheets("参数表")
- j = .Cells(65536, 2).End(xlUp).Row
- For i = 2 To j
- key = .Cells(i, 2)
- If dic.exists(key) Then .Cells(i, 1) = dic(key)
- Next i
- End With
- MsgBox "更新updata_参数表Ok"
- End Sub
- Sub updata_开料单表()
- Dim arr, i&, j&, key$
- Dim dic As Object
- Set dic = CreateObject("scripting.dictionary")
- arr = Sheets("参数表").UsedRange
- For i = 2 To UBound(arr)
- dic(arr(i, 2)) = arr(i, 3)
- Next i
- With Sheets("电子锯开料单")
- j = .Cells(65536, 4).End(xlUp).Row
- For i = 4 To j
- key = .Cells(i, 11)
- If dic.exists(key) Then .Cells(i, 11) = dic(key)
- Next i
- End With
- MsgBox "更新开料单表Ok"
- End Sub
复制代码 |
|