关于exccel不能同时自动换行和缩小字体填充的一点VBA编程小尝试
VBA代码如下:Sub 字体调整()
ActiveCell.Font.Size = 10
ActiveCell.WrapText = False
ActiveCell.ShrinkToFit = False
For i = 10 To 1 Step -0.5
If Len(ActiveCell) <= Fix(ActiveCell.MergeArea.Width / i) * Fix(ActiveCell.MergeArea.Height / (i + 2)) Then
ActiveCell.WrapText = True
ActiveCell.Font.Size = i
Exit For
Else
ActiveCell.ShrinkToFit = True
End If
Next
End Sub
页:
[1]