How can I get comment from excel?

Z

zq1956

I use Comment.Text to get it,it show 800A01B6.
I can use Comment.Author to get right value.
Is the method wrong?
how can I get comment from excel?
thx!
 
G

Gary''s Student

Sub commment()
Dim c As Comment
Set c = Range("C8").Comment
MsgBox (c.Text)
End Sub
 
P

Patrick Molloy

Range("A1").Comment.Text

here's a demo that takes the comment and places it into the next cell to the
right

Option Explicit
Sub GetComment()
Dim cellall As Range
Dim cell As Range
Dim addr As String
Set cellall = ActiveSheet.Cells.SpecialCells(xlCellTypeComments)
If Not cellall Is Nothing Then
For Each cell In cellall.Cells
addr = cell.Address
cell.Offset(, 1) = cell.Comment.Text
Next
End If
End Sub
 
Top