Good evening Seanzies
This is still quite possible, but it does complicate matters a little because you're going to have to start hiding sheets and avoiding errors that this brings if you try to select a sheet that is hidden etc, you just need to remember to cover all bases. First off, hide Sheet2 (Format > Sheet > Hide). You will need the event procedure, which has changed slightly:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If ActiveSheet.Name = "Sheet2" Then
Sheets("Sheet1").Select
a = InputBox("Enter Password:")
End If
If a = "pass" Then
Application.EnableEvents = False
Sheets("Sheet2").Visible = True
Sheets("Sheet2").Select
Application.EnableEvents = True
Else
Sheets("Sheet2").Visible = False
End If
End Sub
and a new macro:
Sub Test()
If Sheets("Sheet2").Visible = True Then
Sheets("Sheet2").Select
Exit Sub
End If
Sheets("Sheet2").Visible = True
Sheets("Sheet2").Select
End Sub
Draw a button on Sheet1 using the Forms toolbar, and right click on the button and select assign macro, and assign Test to it. This button will then kick of the event, show the password box but keep the sheet hidden until the correct password is entered.
You will also need to set up a macro on Sheet2 to rehide the sheet and select Sheet1, to return everything to the status quo.
HTH
DominicB