Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Is there a way that I can password protect a worksheet

Does anyone know if there is a way that I can password protect a worksheet
but still leave access to the rest of the workbook?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Is there a way that I can password protect a worksheet

Hi,

Alt +F11 to open VB editor. Double click 'This workbook' and paste the code
below in. This does what you want but isn't secure. If a user doesn't
enable macros they see the sheet. Anyone with even a small amount of
knowledge and Google would view your sheet in seconds. Change "Sheet1" to
whichever you want


Private Sub Workbook_SheetActivate(ByVal Sh As Object)
MySheet = "Sheet1"
If ActiveSheet.Name = MySheet Then
ActiveSheet.Visible = False
response = InputBox("Enter password to view sheet")
If response = "MyPass" Then
Sheets(MySheet).Visible = True
Application.EnableEvents = False
Sheets(MySheet).Select
Application.EnableEvents = True
End If
End If
End Sub

Mike

"Lin4it" wrote:

Does anyone know if there is a way that I can password protect a worksheet
but still leave access to the rest of the workbook?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Is there a way that I can password protect a worksheet

Missed a line, use this instead

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
MySheet = "Sheet1"
If ActiveSheet.Name = MySheet Then
ActiveSheet.Visible = False
response = InputBox("Enter password to view sheet")
If response = "MyPass" Then
Sheets(MySheet).Visible = True
Application.EnableEvents = False
Sheets(MySheet).Select
Application.EnableEvents = True

End If
End If
Sheets(MySheet).Visible = True
End Sub

Mike

"Mike H" wrote:

Hi,

Alt +F11 to open VB editor. Double click 'This workbook' and paste the code
below in. This does what you want but isn't secure. If a user doesn't
enable macros they see the sheet. Anyone with even a small amount of
knowledge and Google would view your sheet in seconds. Change "Sheet1" to
whichever you want


Private Sub Workbook_SheetActivate(ByVal Sh As Object)
MySheet = "Sheet1"
If ActiveSheet.Name = MySheet Then
ActiveSheet.Visible = False
response = InputBox("Enter password to view sheet")
If response = "MyPass" Then
Sheets(MySheet).Visible = True
Application.EnableEvents = False
Sheets(MySheet).Select
Application.EnableEvents = True
End If
End If
End Sub

Mike

"Lin4it" wrote:

Does anyone know if there is a way that I can password protect a worksheet
but still leave access to the rest of the workbook?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Is there a way that I can password protect a worksheet

To just prevent editing on the sheet go to ToolsProtectionProtect sheet
with a password.

To prevent users from seeing the sheet....................

FormatSheetHide

ToolsProtectionProtect Workbook with a password.

Note: Excel's internal security is very weak so be aware that a determined
user will be able to crack your password quite readily.


Gord Dibben MS Excel MVP

On Thu, 27 Nov 2008 05:49:01 -0800, Lin4it
wrote:

Does anyone know if there is a way that I can password protect a worksheet
but still leave access to the rest of the workbook?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide and password protect a worksheet Oldjay Excel Discussion (Misc queries) 2 April 30th 08 04:59 PM
Password Protect a Worksheet joinme4coffee Excel Discussion (Misc queries) 8 October 28th 07 07:02 PM
Protect a worksheet with a password colettey29 Excel Worksheet Functions 2 September 26th 06 05:51 PM
password protect worksheet Ben Excel Discussion (Misc queries) 3 February 14th 06 02:30 PM
lost my password (worksheet protect) Dan Winterton Excel Discussion (Misc queries) 1 January 18th 05 07:09 PM


All times are GMT +1. The time now is 03:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"