B
buckag
I am a novice to VBA, but have included the following code to insert a
comment field with the date/time and user name:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 1 Then
comment = ("Cell Last Edited: ") & Now & (" by ") & Application.UserName
Target.Cells.NoteText comment
End If
End Sub
I have a range of cells that are allow particular users to update these
cells. When I turn on the spreadsheet protection I am getting the following
error:
Runtime 1004 Note text Method of Range class failed, and the debugger takes
me to Target.Cells.NoteText comment.
My question is, is there additional code needed? Or is my code bad when
using spreadsheet protection? How can I correct my code?
Any help is appreciated
comment field with the date/time and user name:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 1 Then
comment = ("Cell Last Edited: ") & Now & (" by ") & Application.UserName
Target.Cells.NoteText comment
End If
End Sub
I have a range of cells that are allow particular users to update these
cells. When I turn on the spreadsheet protection I am getting the following
error:
Runtime 1004 Note text Method of Range class failed, and the debugger takes
me to Target.Cells.NoteText comment.
My question is, is there additional code needed? Or is my code bad when
using spreadsheet protection? How can I correct my code?
Any help is appreciated