即使我看过多个YouTube视频和在线教程,也遇到了运行时错误,但仍然遇到运行时错误91。看来我从教程中什么都没缺,但看来我是。就编写.Offset(1,0)之类的东西,我尝试了不同的代码。 任何帮助表示赞赏!
Dim nr As Double
Dim wsl As Worksheet
Set ws1 = Worksheets("Sheet1")
nr = wsl.Cells(Rows.Count, 1).End(xlUp).Row + 1
wsl.Cells(nr, 1).Value = Me.txtProdName.Value
wsl.Cells(nr, 2).Value = Me.txtInvJan.Value
wsl.Cells(nr, 3).Value = Me.txtSpJan.Value
wsl.Cells(nr, 4).Value = Me.txtQtyUnit.Value
wsl.Cells(nr, 5).Value = Me.txtQtyBox.Value
wsl.Cells(nr, 6).Value = Me.txtDateStamp.Value
Unload Me
UserForm1.Show
End Sub