Sub privateprotection()
Dim logIn As Variant
logIn = Sheets("Config").Range("LoggedInAs")
If ActiveCell.Value <> logIn Or Empty <> ActiveCell.Value Then
If MsgBox("This is not you! Continue?", vbYesNo) = vbYes Then
'ThisWorksheet.Unprotect Password:="locked"
ActiveCell.AddComment
ActiveCell.NoteText logIn
'ThisWorksheet.Protect Password:="locked"
Else: MsgBox "No problem - Action Cancelled"
End If
End If
End Sub
People must login to access the workbook. [LoggedInAs]
Changing an empty cell is permitted.
Changing a cell that matches the [LoggedInAs] is permitted.
Changing a cell that contains other data generates a comment attached to the cell containing the [LoggedInAs] identity.
I’ve run into a problem.
This works ok but I want to add the possibility to ADD text to the comment box. I want to keep the text (preferably with a date). Is it possible for users to edit the comment without being able to delete the text already there?
Dim logIn As Variant
logIn = Sheets("Config").Range("LoggedInAs")
If ActiveCell.Value <> logIn Or Empty <> ActiveCell.Value Then
If MsgBox("This is not you! Continue?", vbYesNo) = vbYes Then
'ThisWorksheet.Unprotect Password:="locked"
ActiveCell.AddComment
ActiveCell.NoteText logIn
'ThisWorksheet.Protect Password:="locked"
Else: MsgBox "No problem - Action Cancelled"
End If
End If
End Sub
People must login to access the workbook. [LoggedInAs]
Changing an empty cell is permitted.
Changing a cell that matches the [LoggedInAs] is permitted.
Changing a cell that contains other data generates a comment attached to the cell containing the [LoggedInAs] identity.
I’ve run into a problem.
This works ok but I want to add the possibility to ADD text to the comment box. I want to keep the text (preferably with a date). Is it possible for users to edit the comment without being able to delete the text already there?