• Worksheet protection (XP)

    Author
    Topic
    #385752

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #666570

      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

      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
      
    Viewing 0 reply threads
    Reply To: Worksheet protection (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: