Archive of Mr Excel Message Board


Back to Controls in Excel archive index
Back to archive home

Adding password request

Posted by Dawny on June 24, 2001 9:44 AM
Hi!

I have a little project, which allows users to place, and print orders.
Within the workbook there are a number of worksheets the user is not permitted to access. I have hidden the toolbars, sheet tabs, scroll bars etc, to prevent accidental use.
Occasionally the project will need to be updated to reflect the increase in prices and changes in specifications or part numbers.

Could anyone suggest a way of using a control button to ensure that the person modifying the project is authorised to do so, i.e. call for a password, check that this is valid, if it is, then run a macro, if it is not; tell the user that they are not authorised to change the project.

Thanks for any suggestions,

Dawny


Password lock selected cells.

Posted by Joseph S. Was on June 24, 2001 10:31 AM


Password lock selected cells.

Posted by Joseph S. Was on June 24, 2001 10:37 AM
Note: This will only lock the whole sheet or lock, all the lock selected cells on a sheet.
Private Sub Worksheet_Change(ByVal Target As Range)
'
' Macro by Joseph S. Was
'
Application.EnableEvents = False

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="admin"
Application.EnableEvents = True

Hi!


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.