Thanks for reading I'm in desperate need of help!
I have a Workbook with multiple worksheets which is to be used by multiple users each user is only meant to see relevant information, I've created a user management table and login form and its all working as it should. My issue is when I save and exit then reopens the workbook the sheet i was using is visible behind the password form. So for example, if the workbook had 3 sheets, Sheet1, Sheet2, Sheet3, and 3 Users User, User 2, and User 3, User 1 is admin with access to everything. User2 has access to sheet 1 and User3 has access to sheet 2. If User 1 saves the workbook on sheet 3 and exits excel when user 2 opens it the contents of sheet 3 are visible behind the log in form, I have all the sheets hidden and workbook tabs hidden but the last sheet the workbook was saved on keeps loading behind the login form every time Below is the VBA I'm using If anyone can help it will be greatly appreciated as 3 hours of googling and I'm no closer to a solution.
Thanks in Advance!
Private Sub Workbook_Open1()
ActiveWindow.WindowState = xlMinimized
ThisWorkbook.Application.Visible = False
Application.Windows(1).Visible = False
Login_Frm.Show
End Sub
Private Sub Workbook_Open()
Dim sh As Worksheet
Dim wsh As Worksheet
ThisWorkbook.Unprotect 1234
Set sh = ThisWorkbook.Sheets("User Managment")
sh.Visible = xlSheetVisible
For Each wsh In ThisWorkbook.Sheets
Next
sh.Unprotect 1234
sh.Cells.EntireColumn.Hidden = True
sh.Cells.EntireRow.Hidden = True
sh.Protect 1234
ActiveWindow.DisplayWorkbookTabs = False
ThisWorkbook.Protect 1234
End Sub
I have a Workbook with multiple worksheets which is to be used by multiple users each user is only meant to see relevant information, I've created a user management table and login form and its all working as it should. My issue is when I save and exit then reopens the workbook the sheet i was using is visible behind the password form. So for example, if the workbook had 3 sheets, Sheet1, Sheet2, Sheet3, and 3 Users User, User 2, and User 3, User 1 is admin with access to everything. User2 has access to sheet 1 and User3 has access to sheet 2. If User 1 saves the workbook on sheet 3 and exits excel when user 2 opens it the contents of sheet 3 are visible behind the log in form, I have all the sheets hidden and workbook tabs hidden but the last sheet the workbook was saved on keeps loading behind the login form every time Below is the VBA I'm using If anyone can help it will be greatly appreciated as 3 hours of googling and I'm no closer to a solution.
Thanks in Advance!
Private Sub Workbook_Open1()
ActiveWindow.WindowState = xlMinimized
ThisWorkbook.Application.Visible = False
Application.Windows(1).Visible = False
Login_Frm.Show
End Sub
Private Sub Workbook_Open()
Dim sh As Worksheet
Dim wsh As Worksheet
ThisWorkbook.Unprotect 1234
Set sh = ThisWorkbook.Sheets("User Managment")
sh.Visible = xlSheetVisible
For Each wsh In ThisWorkbook.Sheets
Next
sh.Unprotect 1234
sh.Cells.EntireColumn.Hidden = True
sh.Cells.EntireRow.Hidden = True
sh.Protect 1234
ActiveWindow.DisplayWorkbookTabs = False
ThisWorkbook.Protect 1234
End Sub