Private Sub wordsheet_change(ByVal target As Range)
Dim s As Integer
s = Application.WorksheetFunction.CountA([a1:a65536])
If Cells(s + 1, 3) <> "" Then
Cells(s + 1, 1) = s
Cells(s + 1, 2) = Date
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range) '是worksheet 而不是wordsheet
Dim s As Integer
s = Application.WorksheetFunction.CountA([a1:a65536]) 's值为A列中所有不为空单元格的个数,e.g=2
If Cells(s + 1, 3) <> "" Then '该单元格不为空时,程序运行,e.g=cells(3,3)
Cells(s + 1, 1) = s '赋值,e.g=cells(3,1)
Cells(s + 1, 2) = Date '赋值,e.g=cells(3,2)
End If
End Sub