Forum Discussion
Katie_V
Aug 05, 2020Copper Contributor
Password protecting individual worksheets in excel so each person can only view and edit their own
Hi there, I am looking for a way to protect individual worksheets within in a workbook so that an admin could view and edit all worksheets but staff could only view and edit the worksheet they are a...
NikolinoDE
Aug 05, 2020Platinum Contributor
Apply different passwords or permissions to separate ranges in workbooks in Excel
https://docs.microsoft.com/en-gb/office/troubleshoot/excel/apply-password-to-separate-range
or with VBA
uNam is the login name in the network.
If the employee now logs on, their associated sheet is shown.
When the file is closed, the sheets are hidden and cannot be shown under Format - Sheet.
Private Sub Workbook_Open()
uNam = Environ("Username")
If uNam = "yyy" Then Sheets("Tabelle1").Visible = True
If uNam = "abc" Then Sheets("Tabelle2").Visible = True
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Tabelle1").Visible = xlVeryHidden
Sheets("Tabelle2").Visible = xlVeryHidden
End Sub
Nikolino
I know I don't know anything (Socrates)