Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Hiden sheet code - need access

Hi All,

I love this code below, but I dont know how to access the sheet once
it is hidden.

1st Question - How do I access it using the password?

2nd Question - Is there anyway that I can set this workbook to reveal
the hidden sheet when I use the password to open (not as read only) or
is it macro based only?



Sub HideModeratelyWell()
With Sheets("YourSheetName")
.Protect Password:="ThisIsBreakable"
.Visible = xlVeryHidden
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Hiden sheet code - need access

Sub HideModeratelyWell2()
With Sheets("YourSheetName")
.Unprotect Password:="ThisIsBreakable"
.Visible = xlSheetVisible
End With
End Sub


--


Gary


"J.W. Aldridge" wrote in message
ups.com...
Hi All,

I love this code below, but I dont know how to access the sheet once
it is hidden.

1st Question - How do I access it using the password?

2nd Question - Is there anyway that I can set this workbook to reveal
the hidden sheet when I use the password to open (not as read only) or
is it macro based only?



Sub HideModeratelyWell()
With Sheets("YourSheetName")
.Protect Password:="ThisIsBreakable"
.Visible = xlVeryHidden
End With
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Hiden sheet code - need access

Thanx...

one more trick.

I am working with multiple hidden sheets.
Not sure how to change the code to fit multiple sheets.

With Sheets("INFO SHEET,ROSTER,TIMESHEET,PRODUCTION")

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Hiden sheet code - need access


would help if we knew these were the only sheets in the workbook, but:

Sub unHideModeratelyWell2()
Dim shArray As Variant
Dim i As Long
shArray = Array("INFO SHEET", "ROSTER", "TIMESHEET", "PRODUCTION")
For i = LBound(shArray) To UBound(shArray)
With Sheets(shArray(i))
.Unprotect Password:="ThisIsBreakable"
.Visible = xlSheetVisible
End With
Next
End Sub

Sub HideModeratelyWell2()
Dim shArray As Variant
Dim i As Long
shArray = Array("INFO SHEET", "ROSTER", "TIMESHEET", "PRODUCTION")
For i = LBound(shArray) To UBound(shArray)
With Sheets(shArray(i))
.Protect Password:="ThisIsBreakable"
.Visible = xlVeryHidden
End With
Next
End Sub
--


Gary


"J.W. Aldridge" wrote in message
ps.com...
Thanx...

one more trick.

I am working with multiple hidden sheets.
Not sure how to change the code to fit multiple sheets.

With Sheets("INFO SHEET,ROSTER,TIMESHEET,PRODUCTION")



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Hiden sheet code - need access

»Gary Keramidas« <GKeramidasATmsn.com wrote:

would help if we knew these were the only sheets in the workbook, but:

Sub unHideModeratelyWell2()
Dim shArray As Variant
Dim i As Long
shArray = Array("INFO SHEET", "ROSTER", "TIMESHEET", "PRODUCTION")


Thanks, you just gave me the answer to my thread "VBA - array or
collection literals?"... so the MakeArray function isn't even needed.
However, I'll now stick to using the ParamArray anyway.

For i = LBound(shArray) To UBound(shArray)
With Sheets(shArray(i))
.Unprotect Password:="ThisIsBreakable"
.Visible = xlSheetVisible
End With
Next
End Sub


Simplifying it a bit:

Sub unHideModeratelyWell2()
Dim s As String
For Each s In Array("INFO SHEET", "ROSTER", "TIMESHEET", "PRODUCTION")
With Sheets(s)
.Unprotect Password:="ThisIsBreakable"
.Visible = xlSheetVisible
End With
Next
End Sub

should do it.
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
various printing from a hiden sheet Shawn O'Donnell Excel Programming 3 March 7th 05 09:29 PM
various printing from a hiden sheet Shawn Excel Programming 0 March 7th 05 04:55 PM
various printing from a hiden sheet Don Guillett[_4_] Excel Programming 0 March 7th 05 04:36 PM
hiden sheet scrabtree[_2_] Excel Programming 3 August 4th 04 02:55 PM
code to ask for password to get access to sheet Jonsson[_32_] Excel Programming 2 May 14th 04 01:08 AM


All times are GMT +1. The time now is 02:06 AM.

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"