close

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: www.excelforum.com/member.php...oamp;userid=30329
View this thread: www.excelforum.com/showthread...hreadid=526090
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: www.excelforum.com/member.php...oamp;userid=15101
View this thread: www.excelforum.com/showthread...hreadid=526090
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: www.excelforum.com/member.php...oamp;userid=30329
View this thread: www.excelforum.com/showthread...hreadid=526090
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: www.excelforum.com/member.php...oamp;userid=30329
View this thread: www.excelforum.com/showthread...hreadid=526090
Neo1 Wrote:
gt; Any help to create a macro to unprotect worksheet but before it does to
gt; pop up the dialogue box asking user to enter password to unprotect
gt; worksheet?
gt;
gt; I need help pleasee
gt; Thanks a lot
gt; 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 quot;View Codequot;.
Paste the folowing code there. Don't forget to replace your password
where it says quot;your password goes herequot;

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: www.excelforum.com/member.php...oamp;userid=28934
View this thread: www.excelforum.com/showthread...hreadid=526090
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: www.excelforum.com/member.php...oamp;userid=30329
View this thread: www.excelforum.com/showthread...hreadid=526090

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()