Mister_joe
04-10-2014, 10:56 AM
Hello there,
I have a main range in a worksheet. I need to copy sections of this main range and paste in separate regions of the same worksheet. This way, I would have subsets of the main range. The sub ranges need to remember their parent range. So, I decided to store the name of the parent range in the comment property of the sub range. The comment should be invisible. However, I am having trouble using the AddComment method of the range object. See the code snippets below:
Selection.AddComment myRange(1).Name
Selection.Comment.Visible = False
Debug.Print Selection.Comment
The command Selection.AddComment myRange(1).Name brings up an error message that says "Invalid procedure call or argument"
Selection.NoteText myRange(1).Name
Debug.Print Selection.NoteText
The Debug.Print Selection.NoteText returns the expected comment; something like ='Sheet1'!$F$25:$I$130, but then I cannot make the comment invisible.
Could you please enlighten me on how to use the Addcomment method of the range object. I am using Excel 2007.
I have a main range in a worksheet. I need to copy sections of this main range and paste in separate regions of the same worksheet. This way, I would have subsets of the main range. The sub ranges need to remember their parent range. So, I decided to store the name of the parent range in the comment property of the sub range. The comment should be invisible. However, I am having trouble using the AddComment method of the range object. See the code snippets below:
Selection.AddComment myRange(1).Name
Selection.Comment.Visible = False
Debug.Print Selection.Comment
The command Selection.AddComment myRange(1).Name brings up an error message that says "Invalid procedure call or argument"
Selection.NoteText myRange(1).Name
Debug.Print Selection.NoteText
The Debug.Print Selection.NoteText returns the expected comment; something like ='Sheet1'!$F$25:$I$130, but then I cannot make the comment invisible.
Could you please enlighten me on how to use the Addcomment method of the range object. I am using Excel 2007.