我的目标是记录构建过程记录库存标签,然后跟进验证成品的检查表。由于我只在第一阶段(记录库存标签),我还有很长的路要走。将用户窗体中的数据传输到工作表
我想用我的UserForm做什么是使用手持式扫描仪扫描条形码(库存标签),并让他们填充底层的电子表格,当我点击“提交”按钮。但是,下面的代码会生成此错误:
Run Time Error '424' object required
我在做什么错?
Private Sub cmdSubmit_Click()
Dim eRow As Long
eRow = Database.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Cells(eRow, 1).Value = txtDeviceID.Text
Cells(eRow, 2).Value = txtUserName.Text
Cells(eRow, 3).Value = txtUserNumber.Text
Cells(eRow, 4).Value = txtCloneDevice.Text
Cells(eRow, 5).Value = txtCartAssembly.Text
Cells(eRow, 6).Value = txtPC.Text
Cells(eRow, 7).Value = txtMonitor.Text
Cells(eRow, 8).Value = txtUPS.Text
Cells(eRow, 9).Value = txtHub.Text
Cells(eRow, 10).Value = txtKeyboard.Text
Cells(eRow, 11).Value = txtMouse.Text
Cells(eRow, 12).Value = txtPrinter.Text
Cells(eRow, 13).Value = txtWebcam.Text
Cells(eRow, 14).Value = txtScanner.Text
Cells(eRow, 15).Value = txtRFID.Text
我假设'Database'是一个工作表变量。你需要把它放在每个'... Cells ...的前面''像这样'Database.Cells ...' –
数据库就是表格名称(所以我猜它也是一个变量)。将做出改变并看看它是如何工作的。 – CimpleSypher
嘿Pnuts,非常感谢。我需要你的帮助和Neuralgroove。 – CimpleSypher