VBA Code for excel库存pipe理使用条形码扫描

我几乎没有VBA代码的经验。 我有一个用于库存跟踪的excel电子表格,我试图设置一种方法来使用条形码扫描器来自动search电子表格中的扫描号码,并提示用户添加或删除一些关联的项目。

任何人都可以提供帮助写一个代码,可以做到这一点?

这里的目标是在B1中的条形码扫描之后,电子表格将在列C中search相关联的扫描号码,然后提示您更新列E中关联的“库存单位”号码。

操作完成后,B1再次变为空白,准备下一次扫描。

任何帮助将不胜感激!

Sub barcode() Dim barcodeval As String Dim i As Integer Dim j As Integer Dim quantity As Integer i = 1 j = 3 barcodeval = Cells(1, 2) Do While Cells(i, j) <> 0 If barcodeval = Cells(i, j) Then quantity = InputBox("Update number of units in stock", "Update", "Enter new value here") Cells(i, j + 2) = quantity i = i + 1 Else i = i + 1 End If Loop End Sub 
Interesting Posts