top of page

Set All Excel Rows to the Height of the Highest

You can use the below vba code, available here on the Extend Office site, to automatically adjust all of the rows on an Excel worksheet to the height of the highest row.


The process is simple. Right click on cell which contains the most text. (If you're not sure, you can use the LEN formula to find which cell has the greatest number of characters.) Check the height of that row, and then copy it into the column to the right of the data on the worksheet for all rows.


Run the macro, and then select the column which contains the height of the highest row. All of the rows will be set to that height!






Sub rowheight()

'Updateby Extendoffice

Dim hgt As Variant

Dim WorkRng As Range

xTxt = ActiveWindow.RangeSelection.Address

Set WorkRng = Application.InputBox("please select the data range:", "Kutools for Excel", xTxt, , , , , 8)

For Each H In WorkRng

If H.Value > 15 Then

hgt = H.Value

H.EntireRow.Select

Selection.rowheight = hgt

End If

Next H

End Sub



Comments


bottom of page