1
我有這個用於在用戶插入C或P時在Excel工作表上輸入評論,並且我需要在編輯後隱藏評論。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