停止时间自动更新修改

我目前正在使用这个macros:

Private Sub Worksheet_Change(ByVal Target As Range) Dim x As Long x = Target.Row If Target.Column = 2 Or Cells(x, 15) <> "" Or Target.Column = 3 Or Cells(x, 15) <> "" Then Cells(x, 1) = time Cells(x, 1).NumberFormat = "h:mm AM/PM" End If End Sub 

对于我想要的电子表格来说,这是非常好的,但现在我需要多一点修正。 我想要:

从单元格A1和A2中删除macros。

(可能是困难的部分)一旦进入B列,如果需要修改(IE发现拼写错误),时间戳将更新以反映最后的改变。 macros是否可以更改,以便在列A中input的时间戳不会从列B中的第一个条目更改。

目前,如果在B列中input任何内容,macros将填充时间。我无法find一种方法,使其不会在每次修改时“覆盖”时间。

希望你们能帮忙。

非常感谢

 Private Sub Worksheet_Change(ByVal Target As Range) Dim x As Long x = Target.Row If Target.Column = 2 Or Cells(x, 15) <> "" Or Target.Column = 3 Or Cells(x, 15) <> "" Then if Cells(x, 1) = "" then Cells(x, 1) = time Cells(x, 1).NumberFormat = "h:mm AM/PM" End If End if End Sub 

你可以尝试这样的事情。