Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel 2000 how to format the comments font all comments | Excel Discussion (Misc queries) | |||
Finding Top 5 Expense Items with Comments | Excel Discussion (Misc queries) | |||
in excel useing comments how do you add clip art to comments? | New Users to Excel | |||
Comments | Excel Discussion (Misc queries) | |||
Finding comments - help needed ! | Excel Programming |