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