Thread: Last Comment
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Last Comment

Hello Gary,
This seems to work...
'----------------------------
Sub TestForComments()
Dim rngColumn As Excel.Range
Dim objComment As Excel.Comment
Dim lngRow As Long
Dim strText As String
Set rngColumn = ActiveSheet.Columns(2).Cells

For Each objComment In ActiveSheet.Comments
If Not Application.Intersect(objComment.Parent, rngColumn) Is Nothing Then
If objComment.Parent.Row lngRow Then
lngRow = objComment.Parent.Row
strText = objComment.Text
End If
End If
Next
Range("F1").Value = strText
End Sub
'-------------------------------------
Regards,
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Gary''s Student"
wrote in message
...
How do I set a cell equal to the text in the last comment in a column?
--
Gary's Student