Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default Finding comments

Is it possible to move through some data and determine if there is a comment
in the cell in question?

I want to go through a range of cells and if the macro finds a comment, I
want to display a msgbox.

Thanks for the help.....

--
JT
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Finding comments

This code should work...

Public Sub CommentsMessage()
Dim rngFoundComments As Range
Dim rng As Range

On Error Resume Next
Set rngFoundComments = Range("A1:Z100").SpecialCells(xlCellTypeComments)
On Error GoTo 0
If rngFoundComments Is Nothing Then
MsgBox "No Comments"
Else
For Each rng In rngFoundComments
MsgBox rng.Comment.Text
Next rng
End If
End Sub
--
HTH...

Jim Thomlinson


"JT" wrote:

Is it possible to move through some data and determine if there is a comment
in the cell in question?

I want to go through a range of cells and if the macro finds a comment, I
want to display a msgbox.

Thanks for the help.....

--
JT

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Finding comments

This is worth a look:
http://www.contextures.com/xlcomment...l#CopyAdjacent

This too:
http://www.contextures.com/xlcomments03.html#Show

All that code comes from he
http://www.contextures.com/xlcomments03.html#Top


HTH,
Ryan---


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Jim Thomlinson" wrote:

This code should work...

Public Sub CommentsMessage()
Dim rngFoundComments As Range
Dim rng As Range

On Error Resume Next
Set rngFoundComments = Range("A1:Z100").SpecialCells(xlCellTypeComments)
On Error GoTo 0
If rngFoundComments Is Nothing Then
MsgBox "No Comments"
Else
For Each rng In rngFoundComments
MsgBox rng.Comment.Text
Next rng
End If
End Sub
--
HTH...

Jim Thomlinson


"JT" wrote:

Is it possible to move through some data and determine if there is a comment
in the cell in question?

I want to go through a range of cells and if the macro finds a comment, I
want to display a msgbox.

Thanks for the help.....

--
JT

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Finding comments

Do you need to "stop" at the cell when you display the message, or would
just knowing that somewhere in the range is a cell with a comment be
sufficient? If the latter, then try something like this (change the range to
suit your needs)...

Dim R As Range
On Error Resume Next
Set R = Range("A1:Z26").SpecialCells(xlCellTypeComments)
If Not R Is Nothing Then MsgBox "The range has a comment in it."

--
Rick (MVP - Excel)


"JT" wrote in message
...
Is it possible to move through some data and determine if there is a
comment
in the cell in question?

I want to go through a range of cells and if the macro finds a comment, I
want to display a msgbox.

Thanks for the help.....

--
JT


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
excel 2000 how to format the comments font all comments Delquestion Excel Discussion (Misc queries) 1 October 8th 09 02:19 PM
Finding Top 5 Expense Items with Comments ruffnro Excel Discussion (Misc queries) 2 November 20th 08 05:43 PM
in excel useing comments how do you add clip art to comments? dhouse New Users to Excel 2 July 18th 07 08:14 AM
Comments jlschott2 Excel Discussion (Misc queries) 2 October 17th 05 09:44 PM
Finding comments - help needed ! Alex T Excel Programming 0 September 3rd 03 12:44 AM


All times are GMT +1. The time now is 03:40 AM.

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"