LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Insert Comment in Current Call and set then width

Hi,

Try this

Sub AddAndSizeComment()
Dim ComBox As Comment
ActiveCell.AddComment
Set ComBox = ActiveCell.Comment
With ComBox
..Text Text:="My Comment text"
..Visible = True
..Shape.ScaleWidth 2.5, msoFalse, msoScaleFromBottomRight
..Shape.ScaleHeight 3.1, msoFalse, msoScaleFromBottomRight
End With
Set ComBox = Nothing
End Sub

Mike

"moonhk" wrote:

Hi All
How to Insert Comment in Current Call and set then width.
below is records macro generate coding
How to programming ?

My coding stop at .Shape.Select.

Sub InsertComment()
With Cells(ActiveCell.Row, ActiveCell.Column)
.AddComment
.Comment.Visible = True
.Shape.Select
.ShapeRange.ScaleWidth 5.05, msoFalse, msoScaleFromBottomRight
.ShapeRange.ScaleWidth 1.24, msoFalse, msoScaleFromTopLeft
.Comment.Shape.Select True
End With

End Sub


Sub Macro1()
'

Range("S19").AddComment
Range("S19").Comment.Visible = False
Range("S19").Comment.Text Text:="e:" & Chr(10) & ""
Selection.ShapeRange.ScaleWidth 5.05, msoFalse,
msoScaleFromBottomRight
Selection.ShapeRange.ScaleWidth 1.24, msoFalse,
msoScaleFromTopLeft
Range("S19").Comment.Shape.Select True
Range("S19").Comment.Text Text:="e:" & Chr(10) & "zxdfdf"
Range("S23").Select
End Sub

 
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
How do I call current computer time to a cell? Carol G. Excel Worksheet Functions 9 November 14th 08 04:37 AM
Current date in the comment instead of the user ID Gary[_2_] Excel Worksheet Functions 1 October 22nd 07 11:11 PM
How do I insert a comment when the Insert:Comment menu is greyed? none Excel Discussion (Misc queries) 0 May 19th 05 12:36 AM
VBA code to call the name of current file Phatchef24[_4_] Excel Programming 2 September 3rd 04 05:45 PM
call a procedure using current inputs mike allen[_2_] Excel Programming 2 July 2nd 04 12:06 AM


All times are GMT +1. The time now is 06:52 AM.

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"