Set auto-tuning factor for row height

Is it possible to set the coefficient to the autofit property ?. Those. I have a cell 12.75 high. I set wraptext and autofit properties. But when the text in the cell exceeds the first line, its height becomes 38.75. But the text will also correspond to a height of 25.5. Is it possible to do so. If the data grows larger, the row height should increase in relation to the initial height (12.75, 25.5, 38.25, etc.).

+4
source share
2 answers

How do you do Autofit ?

If the text fits in 25.5 and 38.75 , this means that "Autostart" did not work properly.

You can use this line of code to "Auto Confirm"

Rows(1).EntireRow.AutoFit

Where 1 in the above code is the row number of this cell.

+2
source

I usually use the following workaround to get past Excel tricks with the AutoFit method:

Before making AutoFit, set the height / width of the row / column to a very large number, for example 50. For example:

 range.RowHeight = 50 range.EntireRow.AutoFit 
0
source

Source: https://habr.com/ru/post/1403882/


All Articles