Thread: Hiding Rows
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Hiding Rows

Private Sub CommandButton1_Click()
Me.Protect UserInterfaceOnly:=True
Me.EnableSelection = xlUnlockedCells
Rows("5:10").Hidden = Not Rows("5:10").Hidden
End Sub

worked fine for me in Excel 2000. If you have Excel 97, change the
takefocusonclick property to false.

--
Regards,
Tom Ogilvy

"~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