Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide all Sheets
Here is my code!
The last part of code that should hide all sheets do not work , the first part for password is OK. Where have I go wrong! ****************** Sub Auto_Close() ' ' Dim Password 'This line of code is optional Dim myCount 'This line of code is optional Dim i 'This line of code is optional myCount = Application.Sheets.Count Sheets(1).Select 'This line of code selects the 1st sheet For i = 1 To myCount Password = "1234" ActiveSheet.Protect Password, True, True, True If i = myCount Then End End If ActiveSheet.Next.Select Next i Dim myCount1 'This line of code is optional Dim j 'This line of code is optional myCount1 = Application.Sheets.Count heets(1).Select 'This line of code selects the 1st sheet For j = 1 To myCount1 ActiveSheet.Visible = xlSheetVeryHidden If j = myCount1 Then End End If ActiveSheet.Next.Select Next j ActiveWorkbook.Save End Sub ************ Roba |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to hide sheets | Excel Discussion (Misc queries) | |||
Hide Sheets | Excel Discussion (Misc queries) | |||
Can you hide Sheets? | Excel Discussion (Misc queries) | |||
Hide sheets | Excel Worksheet Functions | |||
Hide all sheets but selected sheets - an example | Excel Programming |