ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   prompt password for a worksheet (https://www.excelbanter.com/excel-programming/438619-prompt-password-worksheet.html)

vicky

prompt password for a worksheet
 
how can i prompt a user to enter a password when he tries to unhide a
hidden sheet . the workbook has to be password protected i.e when i
open a workbook all the hidden sheets have to be password protected .

Bob Phillips[_4_]

prompt password for a worksheet
 
You could re-purpose the unhide worksheet menu option.

How do they unhide, from the menu, or do you have an app doing it.

HTH

Bob

"vicky" wrote in message
...
how can i prompt a user to enter a password when he tries to unhide a
hidden sheet . the workbook has to be password protected i.e when i
open a workbook all the hidden sheets have to be password protected .




Eduardo

prompt password for a worksheet
 
hI,
right click in the tab name, view code, copy the following one

Private Sub Worksheet_Activate()
Dim strPassword As String
On Error Resume Next
Me.Protect Password:="MANAGER"
Me.Columns.Hidden = True

strPassword = InputBox("Enter password to access DATA sheet")

If strPassword = "" Then
ActiveSheet.Visible = False
Worksheets("Menu").Select
Exit Sub
ElseIf strPassword < "MANAGER" Then
MsgBox "Password Incorrect "
ActiveSheet.Visible = False
Worksheets("Menu").Select
Exit Sub
Else
Me.Unprotect Password:="MANAGER"
Me.Columns.Hidden = False
End If
Range("a1").Select

On Error GoTo 0
End Sub

Private Sub Worksheet_Deactivate()
On Error Resume Next
Me.Columns.Hidden = True
On Error GoTo 0
End Sub

Change the password for yours, then hide the sheet, when sheet is going to
be unhide it will ask for the password

if this helps please click yes thanks

"vicky" wrote:

how can i prompt a user to enter a password when he tries to unhide a
hidden sheet . the workbook has to be password protected i.e when i
open a workbook all the hidden sheets have to be password protected .
.


vicky

prompt password for a worksheet
 
Thanks a lot For Replying . i have figured out the logic for that . i
just need a code to hide " Format" Menu tool Bar in excel . i.e user
should not be able to access to this menu .

Bob Phillips[_4_]

prompt password for a worksheet
 
Application.Commandbars(1).Controls("Format").Enab led = False

HTH

Bob

"vicky" wrote in message
...
Thanks a lot For Replying . i have figured out the logic for that . i
just need a code to hide " Format" Menu tool Bar in excel . i.e user
should not be able to access to this menu .




Gord Dibben

prompt password for a worksheet
 
Make the worksheets "veryhidden"

They won't be available under FormatSheetUnhide.


Gord Dibben MS Excel MVP

On Wed, 20 Jan 2010 05:46:54 -0800 (PST), vicky
wrote:

Thanks a lot For Replying . i have figured out the logic for that . i
just need a code to hide " Format" Menu tool Bar in excel . i.e user
should not be able to access to this menu .




All times are GMT +1. The time now is 02:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com