Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there a way to work with all sheets in a workbook without creating a (massive) array. I need to be able to protect and hide all worksheets in a workbook bar the home page.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'd just loop through the worksheets collection:

    Code:
    	Dim oSh As Worksheet
    	'No visble sheets is not allowed, so
    	'make sure the home sheet is visible:
    	Worksheets("Home").Visible = xlSheetVisible
    	For Each oSh In ThisWorkbook.Worksheets
    		If Not oSh.Name = "Home" Then
    			oSh.Visible = xlSheetHidden
    		End Sub
    	Next
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •