当用户插入 C 或 P 时,我可以在 Excel 工作表上输入评论,我需要在编辑后隐藏评论。
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("A1:S1000")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
Select Case Range(Target.Address)
Case "C":
minhaCelula = Target.Address
Range(minhaCelula).AddComment ("")
Range(minhaCelula).Comment.Visible = True
Case "P":
minhaCelula = Target.Address
Range(minhaCelula).AddComment ("")
Range(minhaCelula).Comment.Visible = True
End Select
End If
End Sub