View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default comments in Excel

Yep.

Option Explicit
Sub testme02()
Dim myCommentCells As Range
Dim myCell As Range
Dim DestCell As Range

With ActiveSheet
Set myCommentCells = Nothing
On Error Resume Next
Set myCommentCells = .Cells.SpecialCells(xlCellTypeComments)
On Error GoTo 0

If myCommentCells Is Nothing Then
MsgBox "no comments"
Exit Sub
End If

For Each myCell In myCommentCells.Cells
.Cells(myCell.Row, .Columns.Count).End(xlToLeft).Offset(0, 1) _
.Value = myCell.Comment.Text
Next myCell
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Reniek wrote:

Hi,
Is it possible to read with VBA comment in a cell and put it as a text in
the first free cell at the same row?
Thanks for your help.

Ireneusz


--

Dave Peterson