Hi,
Below is the code which update the timestamp in the adjustment column when the value is entered in C or E column.
Now my last step is to lock the entire row when E column is updated or lock all filled cell. So next user update on the the next cell/row which is not updated. I tried lot of option, but my entire sheet is getting locked instead just a row.![]()
Private Sub Worksheet_Change(ByVal Target As Range) Dim WorkRng As Range Dim Rng As Range Dim xOffsetColumn As Integer Set WorkRng = Intersect(Application.ActiveSheet.Range("C:C"), Target) xOffsetColumn = -1 If Not WorkRng Is Nothing Then Application.EnableEvents = False For Each Rng In WorkRng If Not VBA.IsEmpty(Rng.Value) Then Rng.Offset(0, xOffsetColumn).Value = Now Rng.Offset(0, xOffsetColumn).NumberFormat = "hh:mm:ss" Else Rng.Offset(0, xOffsetColumn).ClearContents End If Next Application.EnableEvents = True End If Dim xCellColumn As Integer Dim xTimeColumn As Integer Dim xRow, xCol As Integer xCellColumn = 5 ' a column where cell value is changed xTimeColumn = 6 ' a column where time stamp is updated xRow = Target.Row xCol = Target.Column If Target.Text <> "" Then If xCol = xCellColumn Then Cells(xRow, xTimeColumn) = Now() End If End Sub
Bookmarks