Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a shared worksheet that I have password protected so no one can change
formulas in the cells. I would like to set up macros to provide me with a certain view for printing and research. Everytime I set up the macro and protect the sheet it says that I can not use the macro. Is there anyway around this or will I have to unprotect the sheet everytime I want to use the macro? Any ideas or suggestions would be greatly appreciated. Thank you. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() You could have the macro unprotect the sheet, run what it is suppose to do and then have it re-protect it. -- patrickcairns ------------------------------------------------------------------------ patrickcairns's Profile: http://www.excelforum.com/member.php...o&userid=31790 View this thread: http://www.excelforum.com/showthread...hreadid=515557 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you set up the protection and the macro, then you know the password?
Option Explicit sub testme() dim myPWD as string myPwd = "hi there" activesheet.unprotect password:=myPWD 'do your stuff activesheet.protect password:=mypwd end sub ====== Depending on what your code does, you could even protect it in code (each time the workbook opens) and tell excel that you want to allow your macro to do things that the humans can't. Option Explicit Sub auto_open() With Worksheets("Sheet 99") .Protect Password:="hi there", userinterfaceonly:=True End With End Sub It needs to be reset each time you open the workbook. (excel doesn't remember it after closing the workbook.) But there are a few things that can't be done by your macro--you'll want to test it to see if it works with the stuff you do. Felix wrote: I have a shared worksheet that I have password protected so no one can change formulas in the cells. I would like to set up macros to provide me with a certain view for printing and research. Everytime I set up the macro and protect the sheet it says that I can not use the macro. Is there anyway around this or will I have to unprotect the sheet everytime I want to use the macro? Any ideas or suggestions would be greatly appreciated. Thank you. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions | |||
Macro that password protects a sheet | Excel Discussion (Misc queries) | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions | |||
Copying multiple sheets from one book 2 another and undertake spec | Excel Discussion (Misc queries) | |||
Can a macro format a hidden sheet? | Excel Discussion (Misc queries) |