Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
How can I tell if a cell has a comment in it? Thanks, Bill |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There are options to view them under Tools--Options--View. If you turn on
these options, you can see a) a mark on the corner of cells with comments, or b) the entire comment shows. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Bill" wrote in message k.net... Hello, How can I tell if a cell has a comment in it? Thanks, Bill |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I meant how to determine that using VBA.
"Anne Troy" wrote in message news:685c5$42c1721d$97c5108d$19194@allthenewsgroup s.com... There are options to view them under Tools--Options--View. If you turn on these options, you can see a) a mark on the corner of cells with comments, or b) the entire comment shows. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Bill" wrote in message k.net... Hello, How can I tell if a cell has a comment in it? Thanks, Bill |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think something like that should work...
CommentString = "The Text You want to enter as a comment" With CellToComment If .Comment Is Nothing Then 'test if there is already a comment in the cell .AddComment CommentString Else .Comment.Text CommentString End If End With Alain79 from France "Bill" wrote in message . net... Sorry, I meant how to determine that using VBA. "Anne Troy" wrote in message news:685c5$42c1721d$97c5108d$19194@allthenewsgroup s.com... There are options to view them under Tools--Options--View. If you turn on these options, you can see a) a mark on the corner of cells with comments, or b) the entire comment shows. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Bill" wrote in message k.net... Hello, How can I tell if a cell has a comment in it? Thanks, Bill |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, that is good. I used to use code which trapped for an error til I
learned your way, Alain, from Aaron Blood. Dim Dummy On Error Resume Next Dummy = Range("A1").Comment.Text If Err.Number = 91 Then 'No comment is there 'Do something Else 'Do something else End If On Error GoTo 0 "Alain79" wrote in message ... I think something like that should work... CommentString = "The Text You want to enter as a comment" With CellToComment If .Comment Is Nothing Then 'test if there is already a comment in the cell .AddComment CommentString Else .Comment.Text CommentString End If End With Alain79 from France "Bill" wrote in message . net... Sorry, I meant how to determine that using VBA. "Anne Troy" wrote in message news:685c5$42c1721d$97c5108d$19194@allthenewsgroup s.com... There are options to view them under Tools--Options--View. If you turn on these options, you can see a) a mark on the corner of cells with comments, or b) the entire comment shows. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Bill" wrote in message k.net... Hello, How can I tell if a cell has a comment in it? Thanks, Bill |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just and added thought:
Using the older object model makes working with comments trivial if activecell.NoteText = vbNullString then ' no comment It is also a great way to create a comment or modify a comment without getting into errors and so forth. If you want a list of cells with comments, then use the comments collection for each cmt in activesheet.comments msgbox cmt.parent.address Next -- Regards, Tom Ogilvy "Bill" wrote in message . net... Sorry, I meant how to determine that using VBA. "Anne Troy" wrote in message news:685c5$42c1721d$97c5108d$19194@allthenewsgroup s.com... There are options to view them under Tools--Options--View. If you turn on these options, you can see a) a mark on the corner of cells with comments, or b) the entire comment shows. ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Bill" wrote in message k.net... Hello, How can I tell if a cell has a comment in it? Thanks, Bill |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Edit Menu - Goto - Special - select comments.
If you have any they will be selected |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, menu can select comments on the active sheet. If you want to know
whether a cenn has a comment anywhere in the workbook, without changing the activesheet. Dim W As Workbook Dim S As Worksheet Dim C As Range Set W = ThisWorkbook Dim strCommentText As String For Each S In W.Worksheets For Each C In S.UsedRange If Not (C.Comment Is Nothing) Then strCommentText = C.Comment.Text 'I like to remove the first break in lines strCommentText = Replace(C.Comment.Text, Chr(10), " ") Debug.Print S.Name & "!" & C.AddressLocal(False, False) & " comment: " & _ strCommentText End If Next C Next S wrote in message ups.com... Edit Menu - Goto - Special - select comments. If you have any they will be selected |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
More condensed and using Tom Ogilvy's approach:
Dim S As Worksheet Dim C As comment Dim strCommentText As String For Each S In ThisWorkbook.Worksheets For Each C In S.Comments strCommentText = C.Text 'I like to remove the first break in lines strCommentText = Replace(strCommentText, Chr(10), " ") Debug.Print S.Name & "!" & C.Parent.Address(False, False) & " comment: " & strCommentText Next C Next S End Sub "William Benson" wrote in message ... Yes, menu can select comments on the active sheet. If you want to know whether a cenn has a comment anywhere in the workbook, without changing the activesheet. Dim W As Workbook Dim S As Worksheet Dim C As Range Set W = ThisWorkbook Dim strCommentText As String For Each S In W.Worksheets For Each C In S.UsedRange If Not (C.Comment Is Nothing) Then strCommentText = C.Comment.Text 'I like to remove the first break in lines strCommentText = Replace(C.Comment.Text, Chr(10), " ") Debug.Print S.Name & "!" & C.AddressLocal(False, False) & " comment: " & _ strCommentText End If Next C Next S wrote in message ups.com... Edit Menu - Goto - Special - select comments. If you have any they will be selected |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel 2000 how to format the comments font all 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) | |||
Comments | Excel Discussion (Misc queries) | |||
XP comments | Excel Programming |