MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Hide range function(Help please!!)


Posted by steve w on July 28, 2001 12:55 PM


Can someone tell me why this function wont work.
I'm trying to make it hide ranges. I can make it work by doing something simular on a worksheet change event.Help please
steve w

Function HIDEPAGE(page) As Single

Select Case page
Case 1
With Sheet2.Range("A36:A70")
.EntireRow.Hidden = False
End With
With Sheet3.Range("A36:A70")
.EntireRow.Hidden = False
End With
With Sheet4.Range("A36:A70")
.EntireRow.Hidden = False
End With

Case 0
With Sheet2.Range("A36:A70")
.EntireRow.Hidden = True
End With
With Sheet3.Range("A36:A70")
.EntireRow.Hidden = True
End With
With Sheet4.Range("A36:A70")
.EntireRow.Hidden = True
End With

End Select
End Function


Posted by Dennis on July 28, 2001 9:33 PM


Functions can only return results. They cannot make format changes to a worksheet.