Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding / Unhiding Sheets Larry Fitch Excel Discussion (Misc queries) 1 December 2nd 09 02:42 PM
need code for hiding/unhiding sheets using checkboxes pzx8hf Excel Worksheet Functions 1 August 13th 08 12:11 AM
Hiding and unhiding sheets D.Hay Excel Discussion (Misc queries) 2 December 10th 05 03:59 PM
Hiding/Unhiding sheets and rows (An easy one for most of you....) Dean Goodmen Excel Programming 3 February 23rd 05 08:46 AM
Hiding and Unhiding work sheets Frank[_19_] Excel Programming 3 November 19th 03 11:27 PM


All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"