Gruppe
Allgemein
Problem
Wie kann ich bei Blattschutz Kommentare nur in ungeschützte Zellen eintragen lassen?
StandardModule: basMain
Sub SetComment()
Dim oCmt As Comment
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
If ActiveCell.Locked Then
MsgBox _
prompt:="Eingabe eines Kommentars nicht möglich -" & _
vbLf & "dieser Bereich ist geschuetzt. ", _
Buttons:=vbCritical
Else
ActiveSheet.Unprotect
If Not ActiveCell.Comment Is Nothing Then
ActiveCell.Comment.Delete
End If
ActiveCell.AddComment "Mein Kommentar"
ActiveSheet.Protect
End If
End Sub