Augmenting Excel Row Heights by a Set Value
Recently when editing a long spreadsheet in order to confirm that each row was wide enough to display all of the text inside a cell, I ran into some trouble beyond that posed by cells with too much text to fully display with the maximum row height of 409.5. While Excel's AutoFit Row Height tool on the Home tab usually sets most rows to the correct width, it will not infrequently cut off a line or two of text from rows with cells that contain more than a couple of thousand characters.
In order to address this problem, you can make use of the macro posted here, by Robin. The vba code is copied below.
This code, will augment each row that is specified in a range by a fixed amount that you designate. So if you want to increase rows 2 to 5 by 10 points enter 'rowRow.RowHeight + 10' at the end of the fourth line, and specify 2:5 in quotes in the In Rows parentheses on the third line.
Option Explicit
'v0.1.0
Sub sbChangeRowHeightMulti()
Application.ScreenUpdating = False
Dim rowRow As Range
For Each rowRow In Rows("2:5")
rowRow.RowHeight = rowRow.RowHeight + 10
Next rowRow
Application.ScreenUpdating = True
End Sub
Comments