The following code was working fine:
I introduced a new procedure that also works fine, but subsequently prevents the first macro from working (after the new macro is successfully run). The error message is 'Unable to Set RowHeight property of range class'.
The new macro (causing the problem) is:
Thanks..
Private Sub Show_Hide_Toggle_Top_Info_Rows()
Application.ScreenUpdating = False
On Error Resume Next
If Rows("5:5").RowHeight > 0.25 Then
Rows("5:18").RowHeight = 0.25
Else
Rows("5:18").RowHeight = 18
End If
Range("a1").Select
Application.ScreenUpdating = True
End Sub
I introduced a new procedure that also works fine, but subsequently prevents the first macro from working (after the new macro is successfully run). The error message is 'Unable to Set RowHeight property of range class'.
The new macro (causing the problem) is:
I am guessing it might have something to do with locking the cells but the locked range is below the rows that have height changes applied.Private Sub Reserve()
Dim myRange As Range
Dim myCell As Range
Sheets("E").Unprotect ""
Set myRange = Sheets("E").Range("$d$23:$d$522")
For Each myCell In myRange
If IsEmpty(myCell) Then
Else
myCell.Offset(0, 27).Value = "y"
Sheets("E").Range("$af$21").Copy
myCell.Offset(0, 28).PasteSpecial Paste:=xlPasteValues
myCell.Locked = True
myCell.Interior.ColorIndex = 24
End If
Next myCell
Sheets("E").Protect ""
End Sub
Thanks..