Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 92
Default Decide comment format 'globally'? Restore format with ws_change?

Hi,
I want to show all comments with same format to suit my design. I
didn't find any choice in 'options', unfortunately. Anybody knowing a
good way? What about the way below:

I'm thinking of calling a 'reformat' sub from
worksheet_selectionchange or _change like 'Call CommentFormat(Target)'
to below Sub.

I'm not sure of the object levels, I get error on ' With
rng.Comment.ShapeRange.Font' and 'If Not rng.Comment Is Nothing Then'
always passe code thorugh even then there is no comment etc.


Sub Worksheet_SelectionChange(ByVal Target As Range)
'**************************
If TypeName(Target) = "Range" Then
Call CommentFormat(Target)
End if
End sub


Sub CommentFormat(rng As Range)
'**************************
If Not rng.Comment Is Nothing Then
With rng.Comment.ShapeRange.Font
.Name = "Arial Narrow"
.FontStyle = "Normal"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With

rng.Comment.ShapeRange.Fill.Visible = msoTrue
rng.Comment.ShapeRange.Fill.Solid
rng.Comment.ShapeRange.Fill.ForeColor.SchemeColor = 51
rng.Comment.ShapeRange.Fill.Transparency = 0.3
rng.Comment.ShapeRange.line.Weight = 0.25
rng.Comment.ShapeRange.line.DashStyle = msoLineSolid
rng.Comment.ShapeRange.line.Style = msoLineSingle
rng.Comment.ShapeRange.line.Transparency = 0#
rng.Comment.ShapeRange.line.Visible = msoTrue
rng.Comment.ShapeRange.line.ForeColor.SchemeColor = 8
rng.Comment.ShapeRange.line.BackColor.RGB = RGB(255, 255, 255)
With rng.Comment
.Locked = True
.LockedText = True
End With

End if
End Sub

(When I get this work, I intend to check each format and only change
if it is false)

Happy to all support,
Kind regards
Tskogstrom

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
Can I change the default font for a comment box in excel globally jammin Excel Discussion (Misc queries) 2 December 17th 07 08:24 PM
How do you globally change format from upper to lower case In Mic. RCC User Excel Discussion (Misc queries) 2 May 30th 07 06:02 AM
Set Comment formats 'globally'? tskogstrom Excel Discussion (Misc queries) 0 April 16th 07 08:49 AM
How to globally replace a value and set a format. Nicholas Excel Discussion (Misc queries) 0 September 28th 06 07:25 PM
How do I restore format cells menu? nskalie Excel Discussion (Misc queries) 0 January 3rd 06 10:07 PM


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