Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 318
Default protect unprotect toggle VBA

Hello I want to create a checkbox that when the box is checked rows 1 thru
70 are protected and when the box is unchecked worksheet is unprotected. I
created a macro to protect the sheet, then I created a macro to unprotect the
sheet . I combined both macros but it does not toggle. Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default protect unprotect toggle VBA

Why don't you post your code.


--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Wanna Learn" wrote:

Hello I want to create a checkbox that when the box is checked rows 1 thru
70 are protected and when the box is unchecked worksheet is unprotected. I
created a macro to protect the sheet, then I created a macro to unprotect the
sheet . I combined both macros but it does not toggle. Thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default protect unprotect toggle VBA

Without a crystal ball, it's tough to know why your code doesn't do what you
want. Please post it and then we can assist.

Barb Reinhardt


"Wanna Learn" wrote:

Hello I want to create a checkbox that when the box is checked rows 1 thru
70 are protected and when the box is unchecked worksheet is unprotected. I
created a macro to protect the sheet, then I created a macro to unprotect the
sheet . I combined both macros but it does not toggle. Thanks in advance

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default protect unprotect toggle VBA

I see you've already posted this before and have an answer. I realize the
web interface is having issues, but please verify that your question hasn't
been answered before posting again.




"Wanna Learn" wrote:

Hello I want to create a checkbox that when the box is checked rows 1 thru
70 are protected and when the box is unchecked worksheet is unprotected. I
created a macro to protect the sheet, then I created a macro to unprotect the
sheet . I combined both macros but it does not toggle. Thanks in advance



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 206
Default protect unprotect toggle VBA

On Feb 8, 12:36*pm, Wanna Learn
wrote:
Hello *I want to create a checkbox that when the box is checked rows 1 thru
70 are protected and when the box is unchecked worksheet is unprotected. *I
created a macro to protect the sheet, then I created a macro to unprotect the
sheet . I combined both macros but it does not toggle. * Thanks in advance


What happened to the CheckBox?
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default protect unprotect toggle VBA

Here is a minimal sample

Private Sub CheckBox1_Click()
With CheckBox1
If .Caption = "Protect" Then
ActiveSheet.Protect
.Caption = "Unprotect"
Else
.Caption = "Protect"
ActiveSheet.Unprotect
End If
End With
End Sub

which I attached to a Control Toolbox checkbox

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Wanna Learn" wrote:

Hello I want to create a checkbox that when the box is checked rows 1 thru
70 are protected and when the box is unchecked worksheet is unprotected. I
created a macro to protect the sheet, then I created a macro to unprotect the
sheet . I combined both macros but it does not toggle. Thanks in advance

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
Protect, unprotect Pyrite Excel Discussion (Misc queries) 0 August 15th 08 03:18 PM
Protect/unprotect all sheets at once? wx4usa New Users to Excel 4 July 22nd 08 12:08 AM
Protect / unprotect function sg Excel Worksheet Functions 3 December 6th 07 05:43 AM
Protect-Unprotect all the sheets Gary Excel Worksheet Functions 7 February 26th 07 08:13 PM
Is there any way that you can protect or unprotect a group of wor. CheriT63 Excel Discussion (Misc queries) 9 January 8th 05 08:40 PM


All times are GMT +1. The time now is 05:33 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"