ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Unprotect sheet button!?? (https://www.excelbanter.com/excel-worksheet-functions/80219-unprotect-sheet-button.html)

Neo1

Unprotect sheet button!??
 

Hello I need some 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 got given this code from this forum:

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



but how do i apply it to a button so that whenever I want to unprotect
the sheet I just need to click the button unprotect instead when the
excel file is opened.

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

Please I need help
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=527516


Martin

Unprotect sheet button!??
 
Type the following instead of "your password goes here" in your existing code:

InputBox("Please type password")

"Neo1" wrote:


Hello I need some 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 got given this code from this forum:

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



but how do i apply it to a button so that whenever I want to unprotect
the sheet I just need to click the button unprotect instead when the
excel file is opened.

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

Please I need help
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=527516



Neo1

Unprotect sheet button!??
 

And how can i assign that VB code so that when i click a button which i
made from autoshapes it opens up the dialogue box asking for the
password?

Thanks
From John


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



All times are GMT +1. The time now is 05:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com