我继续在第一个.cells行上出现“语法错误”或“期望的列表分隔符或”,但如果我将其删除,效果很好。
我尝试更改变量名称和类型
Private Sub cmdAdd_Click()
Dim lRows As Long
Dim col As Range
Dim ws As Worksheet
Set ws = Worksheets("Activity")
Set col = Range("A:A")
lRows = Application.WorksheetFunction.Count(col) + 1
'copy the data to the database
With ws
.Cells(1Rows, 1).Value = 1Rows
.Cells(lRows, 2).Value = Me.DateS.Value
End With
End Sub
它应该在A列的最后一个数字之后放置一个数字,但它给了我错误