Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Last Comment

How do I set a cell equal to the text in the last comment in a column?
--
Gary's Student
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Last Comment

Thank you (yet again)
--
Gary's Student


"Jim Cone" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy comment content to cell content as data not as comment Lilach Excel Discussion (Misc queries) 2 June 21st 07 12:28 PM
How can I edit a comment w/o first having to select Show Comment Mary Ann Excel Discussion (Misc queries) 1 August 26th 05 12:34 AM
How do I insert a comment when the Insert:Comment menu is greyed? none Excel Discussion (Misc queries) 0 May 19th 05 12:36 AM
Comment Box Ann Sbaw Excel Discussion (Misc queries) 1 February 25th 05 09:35 PM
a comment plugin & copy paste directly from excel to comment ? fr. RFM Excel Worksheet Functions 0 December 1st 04 11:29 PM


All times are GMT +1. The time now is 09:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"