Results 1 to 2 of 2
Thread: Worksheet protection (XP)
2003-04-05, 17:59 #1
- Join Date
- Oct 2001
- San Bernardino, California, USA
- Thanked 0 Times in 0 Posts
Worksheet protection (XP)
I have created a worksheet and I have been able to protect the cells, etc but I am unable to protect a user from changing the header and footer. Is it possible to do this? If so, how? Thanks, Don. BTW - I am no good at writing code.
2003-04-05, 18:39 #2
- Join Date
- Jul 2002
- Pittsburgh, Pennsylvania, USA
- Thanked 342 Times in 335 Posts
Re: Worksheet protection (XP)
I don't know if if is possible to prevent the change since this doesn't affect the worksheet of the workbook.
You could always have it RESET to what you want via a macro. The attached will set the header and footers for printing and print preview. Change the text as desired.
The code goes into the thisworkbook object not a regular module.
<pre>Private Sub Workbook_BeforePrint(Cancel As Boolean)
.LeftHeader = "Left Header"
.CenterHeader = "Center Header"
.RightHeader = "Right Header"
.LeftFooter = "Left Footer"
.CenterFooter = "Center Footer"
.RightFooter = "Right Footer"