#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 125
Default Comments

I have seen Debra's Contextures - Comments which helped with the following

Sub CommentAdd()
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
cmt.Text Text:=""
End If
With cmt.Shape.TextFrame.Characters.Font
.name = "Arial"
.Size = 12
.Bold = False
.ColorIndex = 0
End With
cmt.Visible = True
cmt.Shape.Select
End Sub

which leaves the comment open so I am using the following to close it

Sub CommentHide()
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
End Sub

OK but I should likea toggle button like the Reviewing Show/Hide all
comments button which would sence that there is one comment showing and
close it. Someting like this (which does not work)

Sub CommentHideShow()
If ActiveSheet.Comments.Visible = True Then
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
Else
ActiveSheet.Comments.Visible = True
End If
End Sub

Any ideas please and thanks

Francis Hookham




  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Comments

Hi Francis

Could you not use

Sub CommentHideShow()
If Application.DisplayCommentIndicator = xlCommentIndicatorOnly Then
Application.DisplayCommentIndicator = xlCommentAndIndicator
Else
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
End If
End Sub

--

Regards
Roger Govier

"Francis Hookham" wrote in message
...
I have seen Debra's Contextures - Comments which helped with the following

Sub CommentAdd()
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
cmt.Text Text:=""
End If
With cmt.Shape.TextFrame.Characters.Font
.name = "Arial"
.Size = 12
.Bold = False
.ColorIndex = 0
End With
cmt.Visible = True
cmt.Shape.Select
End Sub

which leaves the comment open so I am using the following to close it

Sub CommentHide()
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
End Sub

OK but I should likea toggle button like the Reviewing Show/Hide all
comments button which would sence that there is one comment showing and
close it. Someting like this (which does not work)

Sub CommentHideShow()
If ActiveSheet.Comments.Visible = True Then
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
Else
ActiveSheet.Comments.Visible = True
End If
End Sub

Any ideas please and thanks

Francis Hookham




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 125
Default Comments

Thanks Roger but that is the same as the Reviewing toolbar Show/Hide button.
I was hoping that, when there was the one commet open following the first
macro below, it would be sensed and be closed. At present Sub
CommentHideShow needs to be clicked twice - to open the rest and then close
all.

Please don't worry about it - it was just the sort of refinement one enjoys
wasting time on!

Thanks

Francis


"Roger Govier" <roger@technology4unospamdotcodotuk wrote in message
...
Hi Francis

Could you not use

Sub CommentHideShow()
If Application.DisplayCommentIndicator = xlCommentIndicatorOnly Then
Application.DisplayCommentIndicator = xlCommentAndIndicator
Else
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
End If
End Sub

--

Regards
Roger Govier

"Francis Hookham" wrote in message
...
I have seen Debra's Contextures - Comments which helped with the
following

Sub CommentAdd()
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
cmt.Text Text:=""
End If
With cmt.Shape.TextFrame.Characters.Font
.name = "Arial"
.Size = 12
.Bold = False
.ColorIndex = 0
End With
cmt.Visible = True
cmt.Shape.Select
End Sub

which leaves the comment open so I am using the following to close it

Sub CommentHide()
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
End Sub

OK but I should likea toggle button like the Reviewing Show/Hide all
comments button which would sence that there is one comment showing and
close it. Someting like this (which does not work)

Sub CommentHideShow()
If ActiveSheet.Comments.Visible = True Then
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
Else
ActiveSheet.Comments.Visible = True
End If
End Sub

Any ideas please and thanks

Francis Hookham






  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 125
Default Comments

Very strange Roger - I thought I resonded, in fact it is in my Sent Items
folder but does not show in the menews folder - anyway this is a copy:

Thanks Roger but that is the same as the Reviewing toolbar Show/Hide button.
I was hoping that, when there was the one commet open following the first
macro below, it would be sensed and be closed. At present Sub
CommentHideShow needs to be clicked twice - to open the rest and then close
all.

Please don't worry about it - it was just the sort of refinement one enjoys
wasting time on!

Thanks

Francis



"Roger Govier" <roger@technology4unospamdotcodotuk wrote in message
...
Hi Francis

Could you not use

Sub CommentHideShow()
If Application.DisplayCommentIndicator = xlCommentIndicatorOnly Then
Application.DisplayCommentIndicator = xlCommentAndIndicator
Else
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
End If
End Sub

--

Regards
Roger Govier

"Francis Hookham" wrote in message
...
I have seen Debra's Contextures - Comments which helped with the
following

Sub CommentAdd()
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
cmt.Text Text:=""
End If
With cmt.Shape.TextFrame.Characters.Font
.name = "Arial"
.Size = 12
.Bold = False
.ColorIndex = 0
End With
cmt.Visible = True
cmt.Shape.Select
End Sub

which leaves the comment open so I am using the following to close it

Sub CommentHide()
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
End Sub

OK but I should likea toggle button like the Reviewing Show/Hide all
comments button which would sence that there is one comment showing and
close it. Someting like this (which does not work)

Sub CommentHideShow()
If ActiveSheet.Comments.Visible = True Then
Application.DisplayCommentIndicator = xlCommentIndicatorOnly
Else
ActiveSheet.Comments.Visible = True
End If
End Sub

Any ideas please and thanks

Francis Hookham






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
in excel useing comments how do you add clip art to comments? dhouse New Users to Excel 2 July 18th 07 08:14 AM
comments Louise Excel Discussion (Misc queries) 0 September 23rd 06 12:52 AM
? about COMMENTS Wayne Knazek Excel Worksheet Functions 0 August 18th 06 02:13 PM
Comments Help Dave 2005 Excel Worksheet Functions 0 August 29th 05 06:52 PM
Comments LilLiz Excel Discussion (Misc queries) 2 April 2nd 05 12:18 AM


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