Excel – How to increase row height in Excel by X. ie. Add vertical cell padding

microsoft excelmicrosoft-excel-2007vba

I have this report and I want to increase the vertical cell padding to make it easier to read.

Now, typically you could just select multiple rows and change the row height until you're satisfied.

However, in this case, I have cells with wrapped text and multiple lines. I can't change change the the row height, because the wrapped text will get cut off.

What I want to do is increase the row height of a bunch of cells by a certain value.
Rather than just change it to a specify value.

rowheight = rowheight + X


rowheight = X

Can you do this in excel? Will I need VBA?

Best Answer

I'd go for the code below... not sure if there would be a way to apply it for all rows once. I'd be glad (and upvote) if someone else here knows :)

Sub fixRowHeight()

Dim oRange As Excel.Range
Dim oRow As Excel.Range
Dim dblFactor As Double

Set oRange = Sheets(1).Range("A1:B25")
dblFactor = 5

For Each oRow In oRange.Rows

    oRow.RowHeight = oRow.RowHeight + dblFactor

Next oRow

End Sub