ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel WordWrap/AutoFit Problem - the row becomes too tall (https://www.excelbanter.com/excel-programming/309618-excel-wordwrap-autofit-problem-row-becomes-too-tall.html)

Aaron Glazer

Excel WordWrap/AutoFit Problem - the row becomes too tall
 
Hi, everyone.

Thanks in advance for your help; this is my first time posting, as
I've been able to find everything else I needed by combing through the
archives.

This is a problem I've had for a while and have been unable to find a
solution. I'm using a decent amount of VBA code to automatically
create tables. As part of that, I have the labels in each row
automatically WordWrap and Autofit. This works properly 95% of the
time. However, every once and a while, the text will AutoFit to a row
twice the normal height even though the label (and everything else on
the line) only appear to need one line of space, even when printing,
meaning I end up with an extra high row that kills the apperance in my
table.

For example:

A
_______________
1 | label number |
| one here |
----------------
2 | label two |
----------------
3 | |
| label threee |
----------------

1 wraps correctly; 2 doesn't need to wrap; 3 wraps incorrectly and
puts all the text on the second line

There is nothing else in the row that would cause it to create a
double-height row when autofit. It only occurs when the text is very
close to the end of the width of the column (i.e., 47-51 characters,
normally, for my column width of 30), but because its a range and not
always consistent, I can't just write a macro to automatically re-fit
it smaller when it's only on one line.

Does anyone have code that could fix this (or code that would at least
let me check if it really is only on one line instead of two, so that
I could then fix it in code)? Otherwise, I end up having to manually
go through about 800 table to sporadically fix the extra code.

The only thing to note is that I'm using a font that is part of the
Adobe typeset and, while theoretically WYSIWIG, may not be completely.

Any help would be greatly appreciated.

Thanks,

Aaron


All times are GMT +1. The time now is 01:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com