Row Height

H

hyyfte

Someone please help me with this code. I'm trying to write a macro t
autosize an undetermined amount of rows and set a minimum row height o
33.75. Any ideas? I keep stepping through my code and it wil
autosize, but then changes all the rows to 33.75, instead of leavin
the ones alone that have to be larger. Thanks.



Sub Rows()

Selection.Rows.AutoFit

If RowHeight < 33.75 Then
Selection.RowHeight = 33.75
End If

End Su
 
T

Tom Ogilvy

Sub Rows()

Selection.Rows.AutoFit

for each rw in selection.Rows
If rw.RowHeight < 33.75 Then
rw.RowHeight = 33.75
End If
Next
End Sub
 
S

Soo Cheon Jheong

Hi,

Option Explicit
Sub TEST()

If TypeName(Selection) = "Range" Then
Selection.Rows.AutoFit
Dim CL As Range
For Each CL In Selection.Rows
If CL.RowHeight < 33.75 Then CL.RowHeight = 33.75
Next
End If

End Sub

--
Regards,
Soo Cheon Jheong
_ _
^ ^
~
 
Top