I'm using the below VBA code in Excel to password protect a hidden sheet in a workbook labelled "2012 Roster".

Sheet 1 ("Roster") has a VBA Macro to redirect the user to the Sheet 3 ("Leave Database Back End"). Sheet 3 is password protected. If the user inputs the wrong password, they are directed back to Sheet 1 ("Roster").

The problem I have with this code is: if any other Workbook is open when the Workbook "2012 Roster" is open, the VBA Macro imbedded in Sheet 3 ("Leave Database Back End") does not work.

How do I write the code so if any other workbooks are open, that the code directs the user to Sheet 3 ("Leave Database Back End") on the open workbook "2012 Roster", upon correct entry of password?

See below the VBA code.

Please Login or Register  to view this content.