Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding Rows
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding Rows
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding Rows
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding Rows
The sheet is protected, userinterfaceonly:= true
The OP already protect it with userinterfaceonly:= true The macro should run correct -- Regards Ron de Bruin http://www.rondebruin.nl "IC" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Color alternate rows when after hiding selected rows | Excel Worksheet Functions | |||
Hiding Specific Rows Based on Values in Other Rows | Excel Worksheet Functions | |||
Hiding a button when hiding rows | Excel Discussion (Misc queries) | |||
Hiding Rows if the linked rows are blank | Excel Discussion (Misc queries) | |||
Copying Rows when hiding other rows | Excel Worksheet Functions |