Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    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.

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    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.
    BUT,
    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.

    Steve
    <pre>Private Sub Workbook_BeforePrint(Cancel As Boolean)
    With ActiveSheet.PageSetup
    .LeftHeader = "Left Header"
    .CenterHeader = "Center Header"
    .RightHeader = "Right Header"

    .LeftFooter = "Left Footer"
    .CenterFooter = "Center Footer"
    .RightFooter = "Right Footer"
    End With
    End Sub
    </pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •