PDA

View Full Version : Deleting Comment Indicators for Comments in Selected Range



vanhunk
03-07-2019, 04:06 AM
Deleting Comment Indicators for Comments in Selected Range

Is it at all possible to delete the comment indicators for comments in a selected range, using vba?

Maybe using intersection and shapes?

Thank you very much
van hunk

vanhunk
03-12-2019, 04:58 AM
I gather this can't be done for some unknown reason, or am I wrong?

snb
03-12-2019, 05:31 AM
You can't change this property on Range, nor on Sheet level.
The only thing you can do is to change in for Excel (Application) completely.

On Range level you can only change the visiblility of the comment itself.


Sub M_snb()
For Each it In Cells.SpecialCells(xlCellTypeComments)
it.Comment.Visible = False
Next

Application.DisplayCommentIndicator = 0 ' xlNoIndicator
Application.DisplayCommentIndicator = -1 ' xlCommentIndicatorOnly
Application.DisplayCommentIndicator = 1 ' xlCommentAndIndicator
End Sub


But the most important question: why would you ?

vanhunk
03-12-2019, 07:32 AM
@snb

I have a table (grid) with a comment in each cell, the comments are dynamic but obvious and the comment indicators look ugly. There are however comments elsewhere for which I would like to have the indicator, because it is not obvious that those cells contain comments and I would like the the user to look at it.

Thank you
Regards
vanhunk

snb
03-12-2019, 09:48 AM
If that wish is worksheet-dependent you could consider to use


Application.DisplayCommentIndicator = 0

In the worksheet_activate event.