View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Cathy Cathy is offline
external usenet poster
 
Posts: 104
Default showing hidden rows on a protected sheet

SUCCESS!! Many thanks!
--
Cathy


"Dave Peterson" wrote:

First, remember to use the real password--I guessed at "Cathy!".

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$30" Then
Application.ScreenUpdating = False
me.unprotect password:="your real password here!"
If me.Range("E30").Value = 0 Then
me.Rows("144:370").Hidden = True
ElseIf Range("E30").Value = 1 Then
me.Rows("144:370").Hidden = False
End If
me.protect password:="your real password here!"
Application.ScreenUpdating = True
End If
End Sub

cathy wrote:

Dave:

I added what you said into the code below & I received an error message.
Here's how it looks.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$30" Then
Application.ScreenUpdating = False
If Range("E30").Value = "0" Then
Rows("144:370").Hidden = True
ElseIf Range("E30").Value = "1" Then
Rows("144:370").Hidden = False
Me.Unprotect Password:="Cathy!"
'do the work that hides/shows
Me.Protect Password:="Cathy!"
End If
Application.ScreenUpdating = True
End If
End Sub

--
Cathy

"Dave Peterson" wrote:

I bet you're using some event code (worksheet_change event???) to hide/show
those rows.

You can add a line to unprotect the worksheet, do the work, then reprotect the
worksheet:

me.unprotect password:="Cathy!"
'do the work that hides/shows
me.protect password:="Cathy!"



cathy wrote:

I have a password protect worksheet. Cell E30 is a data validation drop down
list that offers two options "0" or "1". When "1" is selected unhidden rows
144 - 370 appear. When "0" is selected, they remain hidden.

This works great until I set up the protection. Then the hidden cells do
not appear as they are suppose to.

How can I get around this?
I'm not that well versed in code - so any detail is appreciated.
--
Cathy

--

Dave Peterson


--

Dave Peterson