a question about cell text wrap

W

wcc

Hi groups,

If a cellformat's WrapText property is True, can it be determined how many
lines of text are in that cell? And further, what is the content of each
line? Thanks very much for any suggestion,

wcc
 
N

Nigel

The extent of Cell Wrapping is a function of the Cell ColumnWidth and most
of the Font properties. AFAIK there is not a function that provide the cell
wrapped rows. I suppose you could compute this by inspecting all the cell
properties and calculating it, but for non-fixed fonts that wouldn't be
possible.

Cheers
Nigel
 
F

Frank Kabel

Hi
AFAIK there's no suh property. You may claculate it on
your own (but this may be quite difficult):
- get the height and width of the cell
- get the font type + size
get the number of character
- calculate based on these information the number of line
(not taking into account at which position a linebreak
happens)
 
W

wcc

Thanks Frank & Nigel. I'm new to excel VBA. But I guessed it won't be easy
since I didn't find the property/method of cell/range for this purpose. The
reason why i'm interested in this is when importing excel table into AutoCAD
drawing, to be able to acheive WYSIWYG, you have to figure out this part.
And I've seen even some commerical CAD add-on softwares do not address this
issue.

Regards,
wcc
 
N

Nigel

You could of course manually change the column width of the wrapped cells
which would remove the wrapping.
Might help for the export process.
I would have thought that if you exported the Excel data into text file the
cell wrapping would not occur. Assumes of course that the CAD package can
read this file.

Cheers
Nigel
 
Top