再一次关于单元格格式
cell.EntireRow.WrapText = True
cell.EntireRow.AutoFit
cell.IndentLevel = 1 ' AutoFit is discarded
或反转
cell.IndentLevel = 1
cell.EntireRow.WrapText = True
cell.EntireRow.AutoFit ' IndentLevel is discarded
那么,是否可以将单元格缩进级别和行高自动调整保持在一起?
您可能
希望同时设置RowHeight
和ColumnWidth
。
出于某种原因,如果列宽开始比您需要的宽,似乎列自动适合有效,所以试试这个
With cell
.WrapText = True
.IndentLevel = 1
.ColumnWidth = 255
.EntireRow.AutoFit
.EntireColumn.AutoFit
End With