如何在与用户表单不同的电子表格上添加数据?

时间:2019-07-30 02:00:36

标签: excel vba

UserForm当我运行代码时,它说应用程序定义的错误或对象定义的错误。我该如何解决?

Private Sub brandadd_Click()

Dim wks As Worksheet
Dim AddNew As Range
Set wks = Worksheets("Database")

Set AddNew = wks.Range("A5000").End(x1Up).Offset(1, 0)

AddNew.Offset(0, 0).Value = brandcode.Text
AddNew.Offset(0, 0).Value = brandname.Text


End Sub

0 个答案:

没有答案