Hi Shamit,

You may use the below macro in Sheet 2 ...Worksheet_activate event. Attached is 
solution for your reference.

Private Sub Worksheet_Activate()

Sheet2.Protect "Ayush"

Dim pass As String

pass = InputBox("Enter password to unprotect sheet")

If pass = "Ayush" Then


    Sheet2.Unprotect "Ayush"
    
    
Else

    MsgBox " Incorrect Password"
    Worksheets(1).Activate

End If

End Sub


OR 

You may also use protect sheet option by right click on SHEET 2 Tab of workbook.


Please let us know if you need any further assistance. Also, Please remember to 
start new thread for your new queries.

Best regards,
Ayush Jain
Group owner

--- On Sat, 26/12/09, Shamit Shailesh <shamitshail...@rediffmail.com> wrote:

From: Shamit Shailesh <shamitshail...@rediffmail.com>
Subject: $$Excel-Macros$$ max_units_on_a_day
To: excel-macros@googlegroups.com
Date: Saturday, 26 December, 2009, 4:10 PM

Dear all



Please help with the following problem:



In Excel 2007 I have three sheets, When I open the workbook I want all the 
sheets to be visible but when I click on say sheet 2 it should prompt for a 
password. If i hide the sheet the very option of sheet 2 is not visible when 
sheet 1 is active. 



Its quite complicated but I hope all of you understand this.



Regards,

Shamit




-- 

----------------------------------------------------------------------------------

Some important links for excel users:

1. Follow us in TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip

2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com

3. Excel tutorials at http://www.excel-macros.blogspot.com

4. Learn VBA Macros at http://www.quickvba.blogspot.com

5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 

 

To post to this group, send email to excel-macros@googlegroups.com

If you find any spam message in the group, please send an email to:

Ayush Jain  @ jainayus...@gmail.com

<><><><><><><><><><><><><><><><><><><><><><>

HELP US GROW !!

 

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe




      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
http://in.yahoo.com/

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us in TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Attachment: Shamit_shailesh.xlsm
Description: application/vnd.ms-excel.sheet.macroenabled.12

Reply via email to