PC Review


Reply
Thread Tools Rate Thread

Amend sub to re-hide comment when activecell change to another

 
 
Max
Guest
Posts: n/a
 
      4th Jan 2008
How could the sub below be amended so that when the activecell is changed to
another via the arrow keys, the comment which was displayed (in the previous
activecell) is hidden again (like mousing over). Currently it stays
displayed. Thanks

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' GS
Dim cmt As Comment
Set cmt = Target.Comment
If cmt Is Nothing Then
Exit Sub
End If
Target.Comment.Visible = True
End Sub


 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      4th Jan 2008
Hi Max,
The following appears to work.
You might want to experiment a little with it...
'--
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' GS
Dim cmt As Comment
Set cmt = Target.Comment
Application.DisplayCommentIndicator = xlNoIndicator
If cmt Is Nothing Then Exit Sub
Target.Comment.Visible = True
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Max"
wrote in message
How could the sub below be amended so that when the activecell is changed to
another via the arrow keys, the comment which was displayed (in the previous
activecell) is hidden again (like mousing over). Currently it stays
displayed. Thanks

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' GS
Dim cmt As Comment
Set cmt = Target.Comment
If cmt Is Nothing Then
Exit Sub
End If
Target.Comment.Visible = True
End Sub


 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      4th Jan 2008
Thanks, Jim. That works, but it switches off all comment indicators in the
book and I can't mouse over to show the comments anymore. Is there a way to
have both functionalities available & working simultaneously?


 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      4th Jan 2008
Max,
There may not be a way, without going to elaborate MouseMove code.
This is as close as I can come for now. (my head hurts)<g>
Jim
'--
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' GS
Dim cmt As Comment
Set cmt = Target.Comment
Application.DisplayCommentIndicator = xlNoIndicator
If cmt Is Nothing Then
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
Else
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
Target.Comment.Visible = True
End If
End Sub
'--



"Max"
wrote in message
Thanks, Jim. That works, but it switches off all comment indicators in the
book and I can't mouse over to show the comments anymore. Is there a way to
have both functionalities available & working simultaneously?


 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      4th Jan 2008
That worked marvellous, Jim!
Many thanks,
Max


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
MsgBox Yes/No/Cancel change to Save/Delete/Amend Glynn Microsoft Access Form Coding 1 12th Aug 2009 12:48 PM
Insufficient pemissions to amend Excel files but can amend Word fi =?Utf-8?B?RiBMYXVmcw==?= Microsoft Windows 2000 Security 0 11th Oct 2006 12:28 PM
How do I hide the comment reference? (not the comment itself). =?Utf-8?B?Sm8gTm9yd2ljaA==?= Microsoft Word Document Management 3 10th Oct 2006 01:35 PM
Amend user name at start of comment Grev Microsoft Excel Misc 6 2nd Feb 2004 04:50 PM
Amend code or change it completely? Gareth Microsoft Excel Programming 2 1st Dec 2003 07:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:21 AM.