Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all
I have a worksheet that contains aprox 8 buttons that each run a macro to complete certain tasks from displaying userforms to moving to another worksheet. Rather than adding code into each macro, is there a way to protect the worksheet, unprotect whilst any macro is run then protect it again once the macro is complete? thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You will have to add code to each button but you can make the code very short
by addin two procedures to do the protection and unprotection. Call the unprotectall macro at the start and the protectall at the end of each command button procedure... sub UnProtectAll dim wks as worksheet for each wks in thisworkbook.worksheets wks.unprotect Password:="Tada" next wks End sub sub ProtectAll dim wks as worksheet for each wks in thisworkbook.worksheets wks.protect Password:="Tada" next wks End sub -- HTH... Jim Thomlinson "Anthony" wrote: Hi all I have a worksheet that contains aprox 8 buttons that each run a macro to complete certain tasks from displaying userforms to moving to another worksheet. Rather than adding code into each macro, is there a way to protect the worksheet, unprotect whilst any macro is run then protect it again once the macro is complete? thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try to find Protect Method/ UserInterfaceOnly in help
mcg Użytkownik "Anthony" napisał w wiadomo¶ci ... Hi all I have a worksheet that contains aprox 8 buttons that each run a macro to complete certain tasks from displaying userforms to moving to another worksheet. Rather than adding code into each macro, is there a way to protect the worksheet, unprotect whilst any macro is run then protect it again once the macro is complete? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protecting worksheet | Excel Programming | |||
Protecting a worksheet | Excel Programming | |||
Un-Protecting a Worksheet | Excel Discussion (Misc queries) | |||
protecting the worksheet | Excel Worksheet Functions |