Lock-Down Excel Headers and Footers

  • Thread starter Thread starter John
  • Start date Start date
J

John

Is there a way to protect the headers and footers in
Excel 2000 so that they cannot be changed or unlocked
without a password?

Thanks
 
You can't do this directly, but you can use a macro to restore your
headers and footers before printing, say, or before saving.

Put this macro in the ThisWorkbook code module (right-click the workbook
title bar and select View Code):

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ActiveWindow.SelectedSheets
With wkSht.PageSetup
.LeftHeader = ""
.CenterHeader = "My Header"
.RightHeader = ""
.LeftFooter = "&P of &N"
.CenterFooter = ""
.RightFooter = Me.FullName
End With
Next wkSht
End Sub

Modify the headers and footers to suit.
 
Back
Top