#2
yiyanxiyin2024-07-30 12:18
|
然后CHATJPT给了这一段
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim changedRow As Long
changedRow = Target.Row
Dim changedCol As Long
changedCol = Target.Column
Dim updateCol As Long
updateCol = 5 '设要更新到第 5 列,您可以根据实际需求修改
If Intersect(Target, Me.UsedRange) IsNot Nothing Then
If changedCol <> updateCol Then
Cells(changedRow, updateCol).NumberFormat = "yyyy/mm/dd hh:mm:ss"
Cells(changedRow, updateCol) = Now()
End If
End If
End Sub
结果就是说第二句有语法错误,VBA小白求大佬指点啊啊啊啊啊啊啊啊啊