Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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
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
ComboBox autosize GIP Excel Worksheet Functions 0 August 21st 10 04:50 PM
Autosize Error willemeulen Excel Discussion (Misc queries) 0 February 25th 10 12:17 PM
TextBox Autosize ESR Excel Discussion (Misc queries) 0 March 13th 09 07:45 PM
AutoSize Command CWillis Excel Discussion (Misc queries) 2 June 1st 06 03:22 PM
Autosize Row Heights Andibevan Excel Discussion (Misc queries) 6 May 11th 05 01:45 PM


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

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"