Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default My CommentBox is Visible Afterwards

I'm trying to get this going
And it works fine, Except after running
And editing a comment (after clicking outside the
Comment box the Comment Box is still selected or at least
Displayed. I have to NOW - at the menu click on View
Comments to turn the display (of it) off.
What can I do (within the Macro) to achieve this?
TIA,

Sub EditComment()
'method suggested by Jon Peltier 2006-03-04
'adds text at end of existing comment text
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
Exit Sub
End If
'type to add comment text to selected shape
cmt.Visible = True
cmt.Shape.Select << the Box comes up and I edit my comment

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default My CommentBox is Visible Afterwards


Hello JimMay,

To get this to work, the comment's Visible property must be set to
False when the editing is done. This can be detected when a different
cell on the Worksheet is selected.

Place this code in each Worksheet's SelectionChange event procedure...

Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
cmt.Visible = False
Next cmtPrivate Sub Worksheet_SelectionChange(ByVal Target As Range)

The result should look like this...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
cmt.Visible = False
Next cmt
End Sub

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=552913

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default My CommentBox is Visible Afterwards

Thank you Leith;
It works great
Jim

"Leith Ross"
wrote in message
:

Hello JimMay,

To get this to work, the comment's Visible property must be set to
False when the editing is done. This can be detected when a different
cell on the Worksheet is selected.

Place this code in each Worksheet's SelectionChange event procedure...

Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
cmt.Visible = False
Next cmtPrivate Sub Worksheet_SelectionChange(ByVal Target As Range)

The result should look like this...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
cmt.Visible = False
Next cmt
End Sub

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=552913


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
Worksheet has to set to visible as it is not visible after saving and closing Excel by VB. Oscar Excel Programming 6 June 21st 05 10:39 PM
Autoshapes not visible on spreadsheet but visible in print preview John Excel Discussion (Misc queries) 3 February 11th 05 10:23 PM
Toggle text to be visible and not visible Dave Y[_3_] Excel Programming 3 January 10th 04 07:27 PM
Toggle Text to be visible and Not visible Dave Y[_3_] Excel Programming 1 January 10th 04 07:16 PM
Toggle Text in a column to be visible or not visible Dave Y[_3_] Excel Programming 4 January 8th 04 08:46 PM


All times are GMT +1. The time now is 09:25 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"