Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect sheets before close
How do I protect (no password needed) specific sheets - say sheet 1; 3 & 6
when a spreadsheet is closed? Ideally I would like to use sheet reference rather than name |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect sheets before close
What you are looking for is the workbook level events stored in thisworkbook
(right click on the XL icon next to the word file in the menu bar and select View Code). Add code something like this assuming that you have not changed the code names of the sheets... Private Sub Workbook_BeforeClose(Cancel As Boolean) Sheet1.Protect Sheet3.Protect End Sub -- HTH... Jim Thomlinson "Saintsman" wrote: How do I protect (no password needed) specific sheets - say sheet 1; 3 & 6 when a spreadsheet is closed? Ideally I would like to use sheet reference rather than name |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect sheets before close
Thanks very much for quick response & helpful answer
"Jim Thomlinson" wrote: What you are looking for is the workbook level events stored in thisworkbook (right click on the XL icon next to the word file in the menu bar and select View Code). Add code something like this assuming that you have not changed the code names of the sheets... Private Sub Workbook_BeforeClose(Cancel As Boolean) Sheet1.Protect Sheet3.Protect End Sub -- HTH... Jim Thomlinson "Saintsman" wrote: How do I protect (no password needed) specific sheets - say sheet 1; 3 & 6 when a spreadsheet is closed? Ideally I would like to use sheet reference rather than name |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protect cells with data on save/close | Excel Worksheet Functions | |||
how to setup a excel sheet to be protect after save and close file | Excel Discussion (Misc queries) | |||
Can I protect a document and still open / close groups | Excel Worksheet Functions | |||
Protect macro and close VBE programatically | Excel Programming | |||
how to protect sheets from VBA? | Excel Programming |