Hello All,
Try as I might, I cannot get this macro to execute without an error ...
The macro errors when trying to set the row height = c.value
If I use this statement instead ...
The row height gets set to 50. But I am unable to set the row height equal to the cell's value.
Anyone know what I am doing wrong?
Thanks,
Steve
Try as I might, I cannot get this macro to execute without an error ...
VBA Code:
Private Sub worksheet_activate()
Dim c As Range
Application.ScreenUpdating = False
' Set Row heights
For Each c In Range("rowheights")
[INDENT]If c.Value = 0 Then ' if zero, then set rowheight to autofit[/INDENT]
[INDENT=2]c.EntireRow.AutoFit[/INDENT]
[INDENT]Else[/INDENT]
[INDENT=2]c.EntireRow.RowHeight = c.Value[/INDENT]
[INDENT]End If[/INDENT]
Next c
End Sub
The macro errors when trying to set the row height = c.value
If I use this statement instead ...
VBA Code:
c.EntireRow.RowHeight = 50
The row height gets set to 50. But I am unable to set the row height equal to the cell's value.
Anyone know what I am doing wrong?
Thanks,
Steve