Как узнать, что текст не помещается в ячейке Excel...

Весь MS Office, программирование на Visual Basic for Applications и MS VB

Модератор: Naeel Maqsudov

Ответить
Аватара пользователя
Busine2009
Сообщения: 322
Зарегистрирован: 18 июл 2009, 15:34
Контактная информация:

т.е. когда имеют место вот такие символы ############.
И можно ли расширить столбец, опираясь только на ячейку с этой ошибкой. Т.е. надо расширить столбец на ширину текста в данной ячейке.
Аватара пользователя
Aent
Сообщения: 1129
Зарегистрирован: 01 окт 2006, 14:52
Откуда: Saratov,Russia
Контактная информация:

Range.AutoFit Method
Changes the width of the columns in the range or the height of the rows in the range to achieve the best fit. Syntax
expression.AutoFit
expression A variable that represents a Range object.
Return Value
Variant
Remarks

The Range object must be a row or a range of rows, or a column or a range of columns. Otherwise, this method generates an error.
One unit of column width is equal to the width of one character in the Normal style.
Example

This example changes the width of columns A through I on Sheet1 to achieve the best fit.
Visual Basic for Applications Worksheets("Sheet1").Columns("A:I").AutoFit
This example changes the width of columns A through E on Sheet1 to achieve the best fit, based only on the contents of cells A1:E1.
Visual Basic for Applications Worksheets("Sheet1").Range("A1:E1").Columns.AutoFit
Андрей Энтелис,
aentelis.livejournal.com
Ответить