Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 318
Default hide unhide rows -Protected sheet

Hello I have a command button in a form
Private Sub CommandButton1_Click()
'hide rows
Dim myRng As Range

Set myRng = Me.Range("a32:a36")

myRng.EntireRow.Hidden = Not (myRng(1).EntireRow.Hidden)

but when I protect the form the button does not work. I also have the rows
and columns hidden
How can I correct this ?
thanks


End Sub
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,071
Default hide unhide rows -Protected sheet

Include code in your macro to Unprotect the sheet, do your stuff, protect
the sheet. Record a macro to find the protect/unprotect code. HTH Otto
"Wanna Learn" wrote in message
...
Hello I have a command button in a form
Private Sub CommandButton1_Click()
'hide rows
Dim myRng As Range

Set myRng = Me.Range("a32:a36")

myRng.EntireRow.Hidden = Not (myRng(1).EntireRow.Hidden)

but when I protect the form the button does not work. I also have the
rows
and columns hidden
How can I correct this ?
thanks


End Sub



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default hide unhide rows -Protected sheet

Hi,
include in your macro unprotect and protect

'To protect

Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.Protect Password:="geo"
Next ws

'To unprotect
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.Unprotect Password:="geo"
Next ws
'


"Wanna Learn" wrote:

Hello I have a command button in a form
Private Sub CommandButton1_Click()
'hide rows
Dim myRng As Range

Set myRng = Me.Range("a32:a36")

myRng.EntireRow.Hidden = Not (myRng(1).EntireRow.Hidden)

but when I protect the form the button does not work. I also have the rows
and columns hidden
How can I correct this ?
thanks


End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default hide unhide rows -Protected sheet

Private Sub CommandButton1_Click()
'hide rows
Dim myRng As Range

Set myRng = Me.Range("a32:a36")
me.unprotect 'Password:="Tada"
myRng.EntireRow.Hidden = Not (myRng(1).EntireRow.Hidden)
me.protect 'Password:="Tada"
--
HTH...

Jim Thomlinson


"Wanna Learn" wrote:

Hello I have a command button in a form
Private Sub CommandButton1_Click()
'hide rows
Dim myRng As Range

Set myRng = Me.Range("a32:a36")

myRng.EntireRow.Hidden = Not (myRng(1).EntireRow.Hidden)

but when I protect the form the button does not work. I also have the rows
and columns hidden
How can I correct this ?
thanks


End Sub

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
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Using Hide, Unhide, and auto filter - select all on a protected sh Pattie Excel Worksheet Functions 1 July 7th 06 04:47 PM
Hide Unhide Rows blackstar Excel Discussion (Misc queries) 2 February 6th 06 09:36 PM
how to hide rows in a protected sheet Prakash Excel Worksheet Functions 7 January 18th 05 02:42 PM
Why can't I show or hide rows in an outline on a protected sheet? rwlass Excel Discussion (Misc queries) 1 December 9th 04 04:38 PM


All times are GMT +1. The time now is 01:03 PM.

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"