Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Neo1
 
Posts: n/a
Default Macro to Unprotect sheet!?


Hello I'm quite stuck, I'm trying to create a macro while the worksheet
is protected and the thing is i click unprotect and the password
dialogue box appears asking me to enter password which is fine, but can
i create a macro so that when it is played it opens this dialogue box
for me to enter password to unprotect sheet?

Thanks a lot
From John


--
Neo1
------------------------------------------------------------------------
Neo1's Profile: http://www.excelforum.com/member.php...o&userid=30329
View this thread: http://www.excelforum.com/showthread...hreadid=526090

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
swatsp0p
 
Posts: n/a
Default Macro to Unprotect sheet!?


try this:


Code:
--------------------
Sub Unprotect sheet()
'Private Sub CommandButton1_Click()

' unprotect Macro

ActiveSheet.unprotect

End Sub
--------------------


If you want to assign this to a button, uncomment the Private Sub line
and comment out (or remove) the Sub line.

HTH

Bruce


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=526090

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Neo1
 
Posts: n/a
Default Macro to Unprotect sheet!?


I dont understand ...what do you mean?

do i need to use VB code for it?

Thanks a lot
From John


--
Neo1
------------------------------------------------------------------------
Neo1's Profile: http://www.excelforum.com/member.php...o&userid=30329
View this thread: http://www.excelforum.com/showthread...hreadid=526090

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Neo1
 
Posts: n/a
Default Macro to Unprotect sheet!?


Any help to create a macro to unprotect worksheet but before it does to
pop up the dialogue box asking user to enter password to unprotect
worksheet?

I need help pleasee
Thanks a lot
From John


--
Neo1
------------------------------------------------------------------------
Neo1's Profile: http://www.excelforum.com/member.php...o&userid=30329
View this thread: http://www.excelforum.com/showthread...hreadid=526090

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Desert Piranha
 
Posts: n/a
Default Macro to Unprotect sheet!?


Neo1 Wrote:
Any help to create a macro to unprotect worksheet but before it does to
pop up the dialogue box asking user to enter password to unprotect
worksheet?

I need help pleasee
Thanks a lot
From JohnHi Neo1,


It sounds like you want the sheet to automaticaly unprotect with a
password.
If this is so, Just add to Bruce's code for the password.

Put this in the Module for the sheet in question.
Right Click on the worksheet tab and select "View Code".
Paste the folowing code there. Don't forget to replace your password
where it says "your password goes here"

Private Sub Worksheet_Activate()
ActiveSheet.Unprotect Password:=your password goes here
End Sub

Same thing without a password:

Private Sub Worksheet_Activate()
ActiveSheet.Unprotect
End Sub


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=526090



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Neo1
 
Posts: n/a
Default Macro to Unprotect sheet!?


yeah ok thanks...but how do i apply it to a button so that whenever i
need to click the unprotect button for the sheet....

and also how can i make it so that each worksheet has a different
password to unprotect it?

Thanks a lot
From John


--
Neo1
------------------------------------------------------------------------
Neo1's Profile: http://www.excelforum.com/member.php...o&userid=30329
View this thread: http://www.excelforum.com/showthread...hreadid=526090

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
apply a macro to all sheets except for a certain sheet minrufeng Excel Discussion (Misc queries) 4 February 22nd 06 03:53 PM
macro sheet select Dave K Excel Discussion (Misc queries) 2 October 21st 05 10:08 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Unprotect sheet when printing bbc1 Excel Discussion (Misc queries) 2 August 31st 05 01:41 AM
2 questions, copying data from sheet to sheet and assigning macro Boris Excel Worksheet Functions 0 December 16th 04 07:11 PM


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