Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Very new to VB. Have managed to paste this code into a workbook:
Option Explicit Private Sub Workbook_Open() Worksheets("Sheet1").Activate End Sub Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) Dim ans Dim sh2 As Worksheet Application.EnableEvents = False If ActiveSheet.Name < "Sheet1" Then Set sh2 = ActiveSheet Sh.Activate Application.ScreenUpdating = False ans = Application.InputBox("Supply password") If ans < False Then If ans = "password" Then sh2.Activate End If End If End If Application.ScreenUpdating = True Application.EnableEvents = True End Sub It works great, but would like to modify it so that I only need to enter the password once to gain access to all worksheets, not each time I change worksheets. Much appreciated, rob |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using VB to password protect, but sheet remains visible | Excel Discussion (Misc queries) | |||
Password Required to View\edit a Sheet in a Workbook with Many She | Excel Discussion (Misc queries) | |||
Protect Workbook vs Worksheet?? | Excel Worksheet Functions | |||
Protect Workbook | Excel Discussion (Misc queries) | |||
Forgot My Workbook Password | Excel Discussion (Misc queries) |