LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
stuck
 
Posts: n/a
Default Using Collapse/Expand with Protected worksheets

Hello -- someone has posted this great code that works well to allow
this, but you need to list each individual worksheet. The problem is,
i want to give my users the option of changing the worksheet tab title,
and in fact this title is referenced repeatedly throughout the
workbook.

isn't there a way to apply this macro to "all worksheets" regardless of
the name?

the original code is below. Thanks very much!:

Private Sub Workbook_Open()


Dim mySheetNames As Variant
Dim iCtr As Long


'change to match your workbook
mySheetNames = Array("sheet1", "sheet2", "sheet3")


For iCtr = LBound(mySheetNames) To UBound(mySheetNames)
With Worksheets(mySheetNames(iCtr))
.Select
.EnableOutlining = True
.Protect Password:="password", _
Contents:=True, UserInterfaceOnly:=True
End With
Next iCtr
End Sub

 
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
How do i unlock protected worksheets? jamesbialek Excel Worksheet Functions 1 June 22nd 05 01:02 PM
HIDING ROWS IN PROTECTED WORKSHEETS kyoung Excel Discussion (Misc queries) 2 June 9th 05 05:17 AM
Protected Worksheets Nikki Patel Excel Worksheet Functions 0 April 22nd 05 08:49 PM
HELP! How do you--> Lock a set of rows but also link worksheets to FRUSTRATED Excel Discussion (Misc queries) 6 December 29th 04 10:05 PM
Sorting protected worksheets Drr Excel Discussion (Misc queries) 1 December 3rd 04 08:13 AM


All times are GMT +1. The time now is 03:04 AM.

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

About Us

"It's about Microsoft Excel"