vba代码实现根据单元格字数设置行高
Sub SetRowHeightByWordCount() Dim cell As Range Dim rowHeight As Double For Each cell In Selection rowHeight = 15 '设置默认行高 If Len(cell.Value) > 0 Then rowHeight = 15 + (Len(cell.Value) \ 10) * 5 '每多10个字符增加5个行高 End If cell.RowHeight = rowHeight '设置行高 Next cell End Sub
原文地址: https://www.cveoy.top/t/topic/dUaq 著作权归作者所有。请勿转载和采集!