Sub AdjustRowHeightBasedOnSelection() Dim rng As Range Dim row As Range
Set rng = Selection ' 使用当前所选单元格范围进行调整行高
For Each row In rng.Rows If row.RowHeight > 14 Then row.RowHeight = row.RowHeight + 10 End If If row.RowHeight > 28 Then row.RowHeight = row.RowHeight + 20 End If If row.RowHeight > 41 Then row.RowHeight = row.RowHeight + 40 End If Next row End Sub