LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 95
Default VB ; How do I detect a Comment in a cell


I have a table where some cells have comments attached ("Insert" -
"Comments"). As these comments are poorly visible, I am trying to lift the
text in a comment box such that I can make it more visible - I want to show
the text that is included in the comment of the selected cell in a designated
worksheet cell (in this case the top left cell of the table)

I can read the text in the comment through

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A2") = Mid(Target.Comment.Shape.AlternativeText, 10)
end sub

(I have included Mid(...,10) to get rid of the "TextBox : ")

However - if a cell does NOT have a comment, the above gives an error.
How can I ensure that does not block the rest of the code from running (ie
more code under Worksheet_SelectionChange)

Txs,

RDWJ
 
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
How To Detect A Negative Number In A Cell Minitman Excel Worksheet Functions 7 March 13th 08 04:12 PM
How to detect characters in cell? Eric Excel Discussion (Misc queries) 1 November 10th 07 02:02 PM
How to detect characters with a cell? Eric Excel Discussion (Misc queries) 12 June 26th 07 03:08 PM
Can I use a function to detect whether a cell is highlighted? Martin Williams Excel Worksheet Functions 2 January 23rd 06 11:51 AM
Is there a function to detect changes in any given cell? Detecting Cell Value Changes Excel Worksheet Functions 1 January 2nd 05 11:16 PM


All times are GMT +1. The time now is 07:21 PM.

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

About Us

"It's about Microsoft Excel"