Feb 28 2022 05:08 PM
I'm trying to set row height for several rows which have different heights by an increase of .5 pixels higher than autofit, is there a way to do this?
Mar 01 2022 12:46 AM
Row height increments by 1 pixel, so there is no point in incrementing it by 0.5 pixels.
Here is code to increment row height by 1 pixel after AutoFit:
Sub AutoFitPlus(rng As Range)
Dim rw As Range
Application.ScreenUpdating = False
rng.EntireRow.AutoFit
For Each rw In rng.Rows
rw.RowHeight = rw.RowHeight + 1 / ActiveWindow.PointsToScreenPixelsX(1)
Next rw
Application.ScreenUpdating = True
End Sub
Sub AutoFitPlusSelection()
AutoFitPlus Selection
End Sub
Select a range, then run AutoFitPlusSelection.