Если у вас все в порядке с каждым нечетным столбцом, вводимым пользователем, и отметками времени, находящимися в четных столбцах (т. Е. Вы можете ввести в столбец A, а отметка времени перейдет в столбец B. Вы можете ввести столбец C и отметка времени будет указана в столбце D и т. д.), затем вы можете использовать это:
Private Sub Worksheet_Change(ByVal Target As Range)
'Only write a timestamp of an odd column changes (because the timestamps go in the even columns)
If Target.Column Mod 2 > 0 Then
'Get the first part of the address, to get the actual column being changed
Dim columnAddress As String
columnAddress = Target.Address
If InStr(columnAddress, ":") > 0 Then
columnAddress = Left(columnAddress, InStr(columnAddress, ":") - 1)
End If
'This will cause the TimeStamp to be undeletable (kind of like na Audit).
'If you want the timestamp to disappear when you clear the column, uncomment the next few lines:
' If Not ActiveSheet.Range(columnAddress).Formula = "" Then
''Write the timestamp for the previous column
ActiveSheet.Range(columnAddress).Offset(0, 1).Formula = Now
' Else
' ActiveSheet.Range(columnAddress).Offset(0, 1).Formula = ""
' End If
End If
End Sub
Вы можете скрыть столбцы там, где вам не нужна отметка времени для отображения.