Hi,
I wish to write a macro that will hide (and another one that will unhide) all the comments in an Excel Sheet in a selected range (which the user selects with the mouse).
I started with a simpler example with a hard-coded range (1 cell only), and it works correctly:
But if I use a range with many cells, like ("K16:L18"), the macro does not work.
Also, I don't want the range to be hard-coded, but allow the user to select his desired range with the mouse.
How can this be done?
I googled, but did not find a solution.
Thanks for helping
Leon
I wish to write a macro that will hide (and another one that will unhide) all the comments in an Excel Sheet in a selected range (which the user selects with the mouse).
I started with a simpler example with a hard-coded range (1 cell only), and it works correctly:
Code:
Sub HideCommentsInSelection()
Dim sh As Worksheet
Dim Rng As Range
Set sh = ThisWorkbook.Sheets("Sheet1")
Set Rng = sh.Range("K16")
Rng.Select
Selection.Comment.Visible = False
End Sub
But if I use a range with many cells, like ("K16:L18"), the macro does not work.
Also, I don't want the range to be hard-coded, but allow the user to select his desired range with the mouse.
How can this be done?
I googled, but did not find a solution.
Thanks for helping
Leon