Makro excel lock cell
Hi, I would like to add an option to excel to display the date and time after adding data to the cell next to it. Everything works fine through macros. The only problem is that when I protect sheet access to the date and time cells, macros do not work.
Is it possible to close editing date and time cells and at the same time make macros in them work?
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 4 Then
ThisRow = Target.Row
Range(“e” & ThisRow).Value = Date
Range(“f” & ThisRow).Value = Format(Time, “Long Time”)
ElseIf Target.Column = 7 Then
ThisRow = Target.Row
Range(“h” & ThisRow).Value = Date
Range(“i” & ThisRow).Value = Format(Time, “Long Time”)
End If
End Sub
Hi, I would like to add an option to excel to display the date and time after adding data to the cell next to it. Everything works fine through macros. The only problem is that when I protect sheet access to the date and time cells, macros do not work.Is it possible to close editing date and time cells and at the same time make macros in them work? Private Sub Worksheet_Change(ByVal Target As Excel.Range)If Target.Column = 4 ThenThisRow = Target.RowRange(“e” & ThisRow).Value = DateRange(“f” & ThisRow).Value = Format(Time, “Long Time”)ElseIf Target.Column = 7 ThenThisRow = Target.RowRange(“h” & ThisRow).Value = DateRange(“i” & ThisRow).Value = Format(Time, “Long Time”)End IfEnd Sub Read More