Private
Sub
cmd_Kommentar_setzen_Click()
ActiveSheet.Unprotect Password:=
""
frm_Tabellenkonfiguration.Hide
Dim
rngAuswahl
As
Range
On
Error
GoTo
LeaveSub
Set
rngAuswahl = Application.InputBox(
"Bitte die Zelle auswählen, die kommentiert werden soll."
, Type:=8)
If
rngAuswahl.Count > 1
Then
MsgBox
"Bitte nur eine Zelle auswählen."
, vbCritical
frm_Tabellenkonfiguration.Show
Exit
Sub
End
If
If
rngAuswahl.Row < 8
Then
MsgBox
"Bitte eine gültige Auswahl verwenden."
, vbCritical
Exit
Sub
End
If
rngAuswahl.
Select
rngAuswahl.AddComment
frm_Kommentartext.Show
LeaveSub:
frm_Tabellenkonfiguration.Show
ActiveSheet.Protect Password:=
""
, AllowFiltering:=
True
End
Sub