Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
comments AutoSize
Hi Group, Has tried to find an answer on this problem in Goggles without result. Has code as below. Works fine, but the Comment TextFrame shows a blank line before the text. This make the Comment Frame a rectangel with the text always at the bottom. Is it possible to remove this blank line by VBA to get the text in the first line of the AutoSized TextFrame? (The text is supposed to be a date in the format: dd mmm) Thankful for any hints. Brgds CG Rosén ----------------------------------------------------- With ActiveCell.AddComment .Visible = False .Text Text:= _ Chr(10) & " text" With ActiveCell.Comment.Shape.TextFrame .HorizontalAlignment = xlLeft .VerticalAlignment = xlTop .AutoSize = True End With End With |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
comments AutoSize
Hi CG Rosén,
You need to remove Chr(10) before your text. Use: With ActiveCell.AddComment .Visible = False .Text Text:= "your text" With ActiveCell.Comment.Shape.TextFrame .HorizontalAlignment = xlLeft .VerticalAlignment = xlTop .AutoSize = True End With End With Regards, Shah Shailesh http://members.lycos.co.uk/shahweb/ *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
comments AutoSize
Thanks Shailesh, works perfect!
Brgds CG Rosén "Shailesh Shah" wrote in message ... Hi CG Rosén, You need to remove Chr(10) before your text. Use: With ActiveCell.AddComment .Visible = False .Text Text:= "your text" With ActiveCell.Comment.Shape.TextFrame .HorizontalAlignment = xlLeft .VerticalAlignment = xlTop .AutoSize = True End With End With Regards, Shah Shailesh http://members.lycos.co.uk/shahweb/ *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ComboBox autosize | Excel Worksheet Functions | |||
Autosize Error | Excel Discussion (Misc queries) | |||
TextBox Autosize | Excel Discussion (Misc queries) | |||
AutoSize Command | Excel Discussion (Misc queries) | |||
Autosize Row Heights | Excel Discussion (Misc queries) |