Hi,
I have an Excel Sheet1 with data in it and several comments scattered here and there.
I think each comment has an identification number automatically assigned to it when it is created?
Maybe ID? or Item? Not sure!
I want a VBA macro to list all the comments to another sheet (say Sheet2) together with the following information:
(a) The identification of the comment.
(b) Its Text.
The reason: I will use them later.
The following thread comes close to my requirement, but it does not display the identification of the comment.
Can you, please help?
Thanks
Leon
---
https://www.mrexcel.com/forum/excel...ents.html?highlight=NEED+TO+SHOW+ALL+COMMENTS
I have an Excel Sheet1 with data in it and several comments scattered here and there.
I think each comment has an identification number automatically assigned to it when it is created?
Maybe ID? or Item? Not sure!
I want a VBA macro to list all the comments to another sheet (say Sheet2) together with the following information:
(a) The identification of the comment.
(b) Its Text.
The reason: I will use them later.
The following thread comes close to my requirement, but it does not display the identification of the comment.
Can you, please help?
Thanks
Leon
---
https://www.mrexcel.com/forum/excel...ents.html?highlight=NEED+TO+SHOW+ALL+COMMENTS
Code:
Sub b()
Dim cmt As Comment
Dim c As Range
Dim aWs As Worksheet
Set aWs = ActiveSheet
Sheets.Add
For Each c In aWs.UsedRange
Set cmt = c.Comment
If Not cmt Is Nothing Then
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) = c.Address
Cells(Rows.Count, 2).End(xlUp).Offset(1, 0) = cmt.Text
End If
Next c
End Sub