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
|