You may also need to unprotect/protect the sheet.
Sub test()
Worksheets(1).Unprotect
' Ron's code
Worksheets(1).Protect
End Sub
Ian
"Ron de Bruin" wrote in message
...
Try this
Sub test()
With ActiveSheet
If .Rows("5:10").EntireRow.Hidden = True Then
.Rows("5:10").EntireRow.Hidden = False
Else
.Rows("5:10").EntireRow.Hidden = True
End If
End With
End Sub
--
Regards Ron de Bruin
http://www.rondebruin.nl
"~Danny~" wrote in message
...
I'd like to have a toggle button on a sheet that
alternately hides and unhides a number of rows, say 5:10
Anyone know how?
I keep getting the error "Unable to set the Hidden
property of the range class"
The sheet is protected, userinterfaceonly:= true and
enableselection = xlunlocked cells
Many thanks