Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The thing is that I have an Excel file with 4 sheets in it.
I want 2 person one after the other to work on the very same file on the same PC. I want the first one to be able to work on the 4 sheets of the file and the second to be able to work and see only the two first sheets of the very same file in the same PC...but not the 2 others which I would like to protect 'alone' with a password. How can this be done? Thank you so much for your help |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Paste the below code in the Open event of the workbook. You will have to use
the macro Editor, select the workbook on the left hand pane. Dim mPasswd As String Dim i As Integer 'Hide last 2 worksheets Sheets(2).Visible = 2 Sheets(3).Visible = 2 'prompt for the password mPasswd = InputBox("Please enter the password!!", "Worksheet locker") 'if the password is correct, show all worksheets If mPasswd = "test" Then For Each sht In ActiveWorkbook.Sheets sht.Visible = True Next Else 'Hide the worksheet Sheets(2).Visible = 2 Sheets(3).Visible = 2 End If You can make necessary changes to suit this to your requirements. Hope this helps!! -- Pranav Vaidya VBA Developer PN, MH-India If you think my answer is useful, please rate this post as an ANSWER!! "Excel Locker" wrote: The thing is that I have an Excel file with 4 sheets in it. I want 2 person one after the other to work on the very same file on the same PC. I want the first one to be able to work on the 4 sheets of the file and the second to be able to work and see only the two first sheets of the very same file in the same PC...but not the 2 others which I would like to protect 'alone' with a password. How can this be done? Thank you so much for your help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
HOW TO LOCK THE OPENING OF A SHEET(TAB)? | Excel Discussion (Misc queries) | |||
HOW TO LOCK THE OPENING OF AN EXCEL SHEET? | Excel Worksheet Functions | |||
How to stop template help when opening a file | Excel Discussion (Misc queries) | |||
how do I stop people opening an excel sheet? | Excel Discussion (Misc queries) | |||
How do I deny opening and viewing any file to any user and lock i. | Excel Discussion (Misc queries) |