worksheet protection

  • Thread starter Thread starter andy
  • Start date Start date
A

andy

does anyone know if / how i could protect the header and
footer of a document, some of the cells within the
document, and still keep some cells open to editing?
thanks
 
Dear Andy

To Protect some cells and not others, select the cells you
want to be active (editable), right-mouse click, and then
select "Format Cells". From there click on
the "Protection" tab and uncheck the "Locked" tick box. OK
all that and then go back to the spreadsheet. Now click on
the Tools menu and select "Protection" from there, and
then select "Protect Worksheet"

As far as protecting the headers and footers from being
edited, one way to do it would be to turn of the "Header
and Footer..." View menu item. This is done by placeing
the following code into a new module attached to your open
workbook.

Sub Auto_Open()
With CommandBars("Worksheet Menu Bar")
With .Controls("View")
.Controls("Header And Footer...").Enabled =
False
End With
End With
End Sub

Hope this helps

Paul Falla
 
I don't think I'd turn off that menu item.

The user can still get it via File|page setup and through the print preview
screen. And it makes the option unavailable to other workbooks that are open.

But if you go with Paul's suggestion, remember to turn it back on when your
workbook closes (at least).

And this next suggestion suffers the same problem as Paul's if the user opens
the workbook with macros disabled.

Instead of protecting the headers/footers, just reset them to what you want when
you print/printpreview.

Record a macro while you make the headers/footers what you want.

Put the code in the ThisWorkbook module in the Workbook_BeforePrint procedure.
 
Back
Top