我想存档按钮所做的操作,但从我的组合框中收到错误,不知道为什么

问题描述

所以我制作了一个带有按钮的 Excel 表格,用于添加/删除库存,如果您输入的库存尚未在系统中,则添加一个新行。这是通过组合框完成的。我有一行粘贴组合框值(用于添加新项目时),并基本上将其复制到另一个单元格中,但由于某种原因,它向我发送了应用程序或对象错误

    Dim C As Range
       With lstRng
        Set C = .Find(cbxList.Value,LookIn:=xlValues)
        If C Is nothing Then
            Range("a65536").End(xlUp).Offset(1,0).Value = cbxList.Value #this one works and adds to the end of my stock list
            Range("b65536").End(xlUp).Offset(1,0).Value = tbxStock.Value
            Range("aa65536").End(xlUp).Offset(1,0).Value = "Stock in"
            Range("ab65536").End(x1Up).Offset(1,0).Value = cbxList.Value
            Range("ac65536").End(xlUp).Offset(1,0).Value = tbxStock.Value
            Range("ad65536").End(xlUp).Offset(1,0).Value = txtDate.Value
            Range("ae65536").End(xlUp).Offset(1,0).Value = txtRequest.Value
            Range("af65536").End(xlUp).Offset(1,0).Value = txtAllocate.Value
            Range("ag65536").End(xlUp).Offset(1,0).Value = txtReason.Value
            Me.cbxList.Value = ""
            Me.tbxStock.Value = ""
            Me.txtDate.Value = ""
            Me.txtRequest.Value = ""
            Me.txtAllocate.Value = ""
            Me.txtReason.Value = ""
        ElseIf Not C Is nothing Then
            C.Offset(0,1).Value = C.Offset(0,1).Value + tbxStock.Value
            Range("aa65536").End(xlUp).Offset(1,0).Value = cbxList.Value #the error is here for this piece. If I mouse over the "cbxList.Value" it shows me the value I entered and if I mouse over the prevIoUs bit it gives me - = <Application-defined or Object-defined error>
            Range("ac65536").End(xlUp).Offset(1,0).Value = txtReason.Value
        End If
    End With
    Me.cbxList.Value = ""
    Me.tbxStock.Value = ""
    Me.txtDate.Value = ""
    Me.txtRequest.Value = ""
    Me.txtAllocate.Value = ""
    Me.txtReason.Value = ""
End Sub

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)