Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default HOW TO LOCK/STOP THE OPENING OF 1 SHEET AMONG 3 IN 1 EXCEL FILE?

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 180
Default HOW TO LOCK/STOP THE OPENING OF 1 SHEET AMONG 3 IN 1 EXCEL FILE?

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
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
HOW TO LOCK THE OPENING OF A SHEET(TAB)? Excel Locker Excel Discussion (Misc queries) 3 September 20th 07 07:11 PM
HOW TO LOCK THE OPENING OF AN EXCEL SHEET? Excel Locker[_2_] Excel Worksheet Functions 1 September 20th 07 03:40 PM
How to stop template help when opening a file Mucker Excel Discussion (Misc queries) 2 March 2nd 07 09:14 AM
how do I stop people opening an excel sheet? KeenBfB Excel Discussion (Misc queries) 1 November 2nd 06 11:02 PM
How do I deny opening and viewing any file to any user and lock i. Leah Wright Excel Discussion (Misc queries) 1 April 22nd 05 11:59 PM


All times are GMT +1. The time now is 02:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"