I know this is an old thread, but today I found it while searching on this problem (so I am posting/sharing my solution) ...
Problem: adding a little height to a series of rows that already have arbitrary/mixed heights.
...via selecting a range of cells in a column and running the following macro code...
Sub IncreaseRowHeightSpacing()
' Select a range of Cells in a Column, then run this to slightly
' Increase the height on each row in selection
Dim CurrentRowHeight As Single
Dim PossNewRowHeight As Single
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
j = 1
For Each r In Selection.Rows
i = r.Row
If i > 1 Then
j = j + 1
With r.Cells(1).MergeArea
CurrentRowHeight = .RowHeight
PossNewRowHeight = .RowHeight + 10 'adjust number here to suit
.RowHeight = IIf(CurrentRowHeight > PossNewRowHeight, _
CurrentRowHeight, PossNewRowHeight)
End With
End If
If i = eor Then Exit For 'eor is row number of last row in range
Next r
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
Please note, I am a bit rusty and I don't have time to clean up...
...the "MergeArea" is likely not necessary and would do well to be changed for more proper range-object-property, but this should work nonetheless.
So for instance, Column A has been set to a certain width and cells...
A1 = three lines of wrapped info
A2 = one line of data
A3 = two lines of wrapped info
I select "rows" 1-3 and autofit the rows, which snaps then to smallest height.
Then I select "cells" A1-A3 and run the macro to add 10px height to each row.
This is not for use with merged cells... that's a different solution altogether.
Cheers,
TwoHawks
Bookmarks