Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Hox to control Comment Shape Sizes?

Hello

I have some difficulties to succeed to control the size of a "Comment box"
(or shape) attached to a cell... - can you help ?
What I want to do is giving to the Comment "box" the same size than the cell
it is attached to...
I tried through the following code lines:
dim CellToComment as range
set CellToComment = ActiveSheet.range ("A1")
CellToComment..AddComment "This is the comment text"
CellToComment.comment.shape.Width = CellToComment.ColumnWidth
CellToComment.comment.shape.Height= CellToComment.RowHeigh

But the results is not what was expected and seems to depend on another
"factor" ...
Is it a Zoom factor? a Display factor?
For a while it work with the following adjustment...
CellToComment.comment.shape.Width = 2.4 * CellToComment.ColumnWidth
CellToComment.comment.shape.Height= CellToComment.RowHeigh/2.2
but was not correct on another PC...

Thaks for your help
Alan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Hox to control Comment Shape Sizes?

Here is the solution to my own problem...
In fact Using ColumnWidth was not a good idea
Better to use Cell.Width that return the value in number of points rather
than a value linked to Characters...
Also here is the right way to proceed:

dim CellToComment as range

set CellToComment = range("A1")

CellToComment.AddComment "Texte du Commentaire"

CellToComment.comment.shape.width = CellToComment.Width

CellToComment.comment.Height = CellToComment.Height

....

@+

"Alain79" wrote in message
...
Hello

I have some difficulties to succeed to control the size of a "Comment box"
(or shape) attached to a cell... - can you help ?
What I want to do is giving to the Comment "box" the same size than the

cell
it is attached to...
I tried through the following code lines:
dim CellToComment as range
set CellToComment = ActiveSheet.range ("A1")
CellToComment..AddComment "This is the comment text"
CellToComment.comment.shape.Width = CellToComment.ColumnWidth
CellToComment.comment.shape.Height= CellToComment.RowHeigh

But the results is not what was expected and seems to depend on another
"factor" ...
Is it a Zoom factor? a Display factor?
For a while it work with the following adjustment...
CellToComment.comment.shape.Width = 2.4 * CellToComment.ColumnWidth
CellToComment.comment.shape.Height= CellToComment.RowHeigh/2.2
but was not correct on another PC...

Thaks for your help
Alan




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
Changing Comment box shape by default Samad Excel Discussion (Misc queries) 2 June 22nd 06 03:24 PM
In excel spreadsheet my comment boxes change sizes randomly why? Scully Excel Worksheet Functions 0 November 11th 05 08:46 PM
Why oh why are my comment boxes changing shape? Marc New Users to Excel 1 April 1st 05 03:54 AM
Combo Box Control keeps changing sizes Michael Excel Worksheet Functions 0 February 16th 05 01:25 AM
changing comment indicator size or shape Mrocka Excel Worksheet Functions 1 December 13th 04 02:53 PM


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