Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Amend sub to re-hide comment when activecell change to another

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Amend sub to re-hide comment when activecell change to another

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Amend sub to re-hide comment when activecell change to another

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?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Amend sub to re-hide comment when activecell change to another

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?


  #5   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Amend sub to re-hide comment when activecell change to another

That worked marvellous, Jim!
Many thanks,
Max


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
2007 / Hide Comment / How? trip_to_tokyo[_3_] Excel Discussion (Misc queries) 2 October 2nd 09 03:37 PM
How do I hide the comment indicators on a web page? JD21 Excel Discussion (Misc queries) 5 September 22nd 08 09:59 PM
Need to Change ActiveCell [email protected] Excel Programming 1 August 14th 06 08:47 AM
Amend code or change it completely? Gareth[_3_] Excel Programming 2 December 1st 03 07:24 PM
code to change activecell neopolitan Excel Programming 2 October 2nd 03 09:05 PM


All times are GMT +1. The time now is 09:02 PM.

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"