View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dean Goodmen Dean Goodmen is offline
external usenet poster
 
Posts: 18
Default Hiding/Unhiding sheets and rows (An easy one for most of you....)

That works great; however how would you hide multiple rows, or a range
of them?

I tried Rows("2:5").Entirerow.Hidden = True, but it did not work...


On Tue, 22 Feb 2005 18:30:44 +1100, "Steve"
wrote:

This hide's a sheet if OK is pressed:

Sub HideSheet()
Dim hideit
hideit = MsgBox("Press OK to hide", vbOKCancel, "Hide Test")

If hideit = 1 Then
Worksheets("Sheet1").Visible = False
Else
Worksheets("Sheet1").Visible = True
End If
End Sub



This does the same with Column C

Sub HideCol()
Dim hideit
hideit = MsgBox("Press OK to hide", vbOKCancel, "Hide Test")

If hideit = 1 Then
Columns("C:C").EntireColumn.Hidden = True
Else
Columns("C:C").EntireColumn.Hidden = False
End If

End Sub

HTH
Steve