|
Sub BOM表()
Dim rn As Range
If Sheets("登记界面").Cells(7, 2) = "" Then
MsgBox "不能生成BOM表,请相应规格!!"
Else
End If
Dim K As Long
For K = 1 To Sheets("BOM表").Cells(1, 6) + 16
If Sheets("BOM表").Cells(K, 1) = Sheets("登记界面").Cells(7, 2) Then
Sheets("登记界面").Range("B14:c29") = Sheets("BOM表").Cells(K, 2).Resize(16, 2).Value
Else
End If
Next K
r = Cells(Rows.Count, 2).End(xlUp).Row
ar = Range("a14:e" & r)
With Sheets("库存表")
rs = .Cells(Rows.Count, 3).End(xlUp).Row
For i = 2 To UBound(ar)
If ar(i, 2) <> "" Then
Set rn = .Range("c2:c" & rs).Find(ar(i, 2), , , , , , 1)
If rn Is Nothing Then MsgBox "库存表中找不到" & ar(i, 2): End
.Cells(rn.Row, 4) = ar(i, 5)
End If
Next i
End With
MsgBox "BOM已生成!"
End Sub
|
评分
-
1
查看全部评分
-
|