|
楼主 |
发表于 2022-6-1 13:51
|
显示全部楼层
大神牛逼,感谢大神
请在帮忙稍作修改下,这段改为当处理页原来是后面填写是 则减去库存,改一下供应商那一栏是“库存”就自动减去库存,其他不变,谢谢大神
Dim rg As Worksheet, rgg As Worksheet
Application.EnableEvents = False
If Target.Count > 1 Then GoTo 100
If Target.Column <> 26 Then GoTo 100
Set rg = Sheets("处理页")
Set rgg = Sheets("工厂库存表")
If Target = "是" Then
For Y = 2 To rgg.Range("A80000").End(3).Row
If rgg.Cells(Y, 1) = Target.Offset(0, -11) Then
If rgg.Cells(Y, 10) - Target.Offset(0, -18) < 0 Or rgg.Cells(Y, 11) - Target.Offset(0, -18) _
Then MsgBox ARR(i, 8) & "的库存量不够!": GoTo 100
If rgg.Cells(Y, 11) = "" Then
rgg.Cells(Y, 11) = rgg.Cells(Y, 10) - Target.Offset(0, -18)
Else
rgg.Cells(Y, 11) = rgg.Cells(Y, 11) - Target.Offset(0, -18)
End If
Target = "已处理"
GoTo 100
End If
Next Y
Else
GoTo 100
End If
100:
Application.EnableEvents = True
|
|