password for each sheet

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I want to create an excel file which will be shared by different users. This file has several sheets called user1, user2, user3, etc

can I give each sheet a different password, so the user associated with that sheet can only open his/her?

thank you very much.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
You would need a sheet that contains the sheet names in column A and their corresponding passwords in column B. When a user opens the file, all sheets would be hidden except for one blank sheet or a "Welcome" sheet with no data and the user would be prompted to enter a password in order to make that sheet visible. Would this work for you?
 
Last edited:
Upvote 0
Yes for sure, is that VBA? thank you so much.

You would need a sheet that contains the sheet names in column A and their corresponding passwords in column B. When a user opens the file, all sheets would be hidden except for one blank sheet or a "Welcome" sheet with no data and the user would be prompted to enter a password in order to make that sheet visible. Would this work for you?
 
Upvote 0
Maybe
Code:
Private Sub Workbook_Open()
   Dim Ws As Worksheet
   Dim Pword As String
   
   For Each Ws In Sheets(Array("User1", "User2", "User3"))
      Ws.Visible = xlSheetVeryHidden
   Next Ws
   Pword = InputBox("Please enter password")
   Select Case Pword
      Case "User1"
         Sheets("User1").Visible = True
      Case "User2"
         Sheets("User2").Visible = True
      Case "User3"
         Sheets("User3").Visible = True
   End Select
End Sub
Change sheets names & passwords to suit
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top