Hi there,
this code inserts a date and the username into the pre-selected (unlocked) cell. If there is something already in that cell, it inserts a line below rather then overwriting it.
If by any chance he clicks onto a locked cell and runs the macro, it will not work due to the locked cell feature (an elegant way around the debug mode is the "On Error GoTo")
But to avoid letting users click on other cells, which are unlocked but meant for other information input, I would like to limit working of that macro to just a range of cells, e.g. B10:B50.![]()
Sub AddDateAndName() On Error GoTo errBox 'Short = Application.UserName If ActiveCell = "" Then ActiveCell = Date & " " & Short & ": " Else ActiveCell = ActiveCell & Chr(10) & Date & " " & Short & ": " End If Exit Sub errBox: MsgBox "Locked Cell!" End Sub
So, if you click within the range, the macro works, otherwise it does nothing.
Thanks for the help.
Bookmarks