Extract Cell Comments?

  • Thread starter Thread starter snoland
  • Start date Start date
S

snoland

Can I systematically extract text from cell comments and
paste them into an adjacent cell?
 
Yes, try

Range("A2").Value = Range("A1").Comment.Text

where range A1 contains your comment and range A2 is the
cell where you want the comment to appear as text.

John Mansfield
The Planning Deskbook
http://www.pdbook.com
 
HI Snoland

This is possibley really basic code but works hope it helps

Sub FIND_THE_COMMENT()
'

Rem WORKS FOR COLUMN A AND PUTS THE RESULT IN COLUMN B
Rem SETUP STICK A FEW COMMENTS IN COLUM A BETWEEN A1 and A100

Dim AAA As String
Range("a1").Select

Application.ScreenUpdating = False

For x = 1 To 100
If ActiveCell.NoteText > "" Then AAA = Cells.NoteText
If AAA > "" Then ActiveCell.Offset(0, 1).Value = AAA
AAA = ""
ActiveCell.Offset(1, 0).Select
Next

Rem BEST N10



End Sub
 
One idea for Comments in Column A put in Column B.

Sub Demo()
Dim Rng As Range
Dim Cell As Range

On Error Resume Next
Set Rng = Columns("A:A").SpecialCells(xlCellTypeComments)
If Rng Is Nothing Then Exit Sub

For Each Cell In Rng.Cells
Cell(1, 2) = Trim(Cell.Comment.Text)
Next Cell
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top