Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection and macros
I need to protect a worksheet, but users need to be able
to click a button that runs a macro (which sorts the protected information). How can I protect it, while still allowing the macro button to work? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection and macros
Add a couple of lines to your macro:
worksheets("sheet1").unprotect password:="hi" 'your sort code worksheets("sheet1").protect password:="hi" Sam wrote: I need to protect a worksheet, but users need to be able to click a button that runs a macro (which sorts the protected information). How can I protect it, while still allowing the macro button to work? Thanks! -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection and macros
Hi Sam,
You need your code to: 1.Unprotect the sheet .Unprotect(Password) 2. Run the button process 3. Re-protect the sheet .Protect Password, DrawingObjects, Contents, Scenarios, UserInterfaceOnly Regards, Sébastien |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
protection and macros
Hi Sam,
You need your code to: 1.Unprotect the sheet using the worksheet method: .Unprotect(Password) 2. Run the button process code 3. Re-protect the sheet using the sheet method .Protect Password, DrawingObjects, Contents, Scenarios, UserInterfaceOnly Regards, Sébastien |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel protection & macros | Excel Discussion (Misc queries) | |||
Macros/Protection/Pivot Tables...HELP | Excel Discussion (Misc queries) | |||
how to hide a list of macros without password protection | Excel Worksheet Functions | |||
macros and protection | Excel Worksheet Functions | |||
Protection & Macros | Excel Programming |