Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding/Unhiding sheets and rows (An easy one for most of you....)
Rows("2:5").Rows.Hidden = True !
Greetings Jonjo "Dean Goodmen" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hiding/Unhiding sheets and rows (An easy one for most of you....)
This should work:
For each R in Rows("2:5") R.Entirerow.Hidden = True Next Greetings, Bunu "Dean Goodmen" schreef in bericht ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hiding / Unhiding Sheets | Excel Discussion (Misc queries) | |||
need code for hiding/unhiding sheets using checkboxes | Excel Worksheet Functions | |||
Hiding and unhiding sheets | Excel Discussion (Misc queries) | |||
Hiding/Unhiding sheets and rows (An easy one for most of you....) | Excel Programming | |||
Hiding and Unhiding work sheets | Excel Programming |