Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Protect Footer

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Does anyone know how to protect a sheets footer? I have the sheet protected but the user can still change the footer.

    Any suggestions?
    Thanks in advance,
    Patrick

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I would say u would need code to disable page setup if thats what your after

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I do not want to disable page setup completely, just the footer. Thanks for the suggestions.

    Anyone know how to do that?
    Thanks in advance,
    Patrick

  4. #4
    MrExcel MVP Jay Petrulis's Avatar
    Join Date
    Mar 2002
    Location
    Chicago, IL USA
    Posts
    2,040
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I don't know how to disable the page setup, but you might want to write your footer in VBA and run it thrrough the workbook_before_print event.

    Something like

    Private Sub Workbook_BeforePrint(Cancel As Boolean)

    YourSheet.rightfooter = "blah, blah, blah"

    End Sub

    Jay

  5. #5
    Board Regular s-o-s's Avatar
    Join Date
    Apr 2002
    Location
    Kissimmee, Florida
    Posts
    384
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm not sure about protecting the footer...

    You could write some code that resets your footer back to your defaults before a print... This code has to be entered into the This Workbook Module, Using the Workbook Object (Not General...Click the left hand drop down)
    Then click the right hand drop down and select Beforeprint. The 1st line of code will appear automatically.

    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    Application.ScreenUpdating = False
    NumOfSheets = Worksheets.Count
    For sh = 1 To Worksheets.Count
    vis = Sheets(sh).Visible
    If vis = 0 Then
    Sheets(sh).Visible = True
    End If
    Sheets(sh).Select
    With ActiveSheet.PageSetup
    .LeftFooter = "Company Name" & Chr(10) & "Confidential"
    .CenterFooter = "&F - &A" & Chr(10) & "&D : &T - Page &P / &N"
    .RightFooter = "Reference No" & Chr(10) & "Prepared by s.o.s XL Solutions"
    End With
    If vis = 0 Then
    Sheets(sh).Visible = False
    End If

    Next sh
    Application.ScreenUpdating = True
    End Sub

    Change the lines between the Width and End Width statments to Your own Info that you want to see.

    At least if someone changes your Footer it will be corrected back before it prints.

    You may want to look at protecting and hiding the code so that determined users cant just overwrite them anyway...


    I'm about to log off now but I hope this helps...maybe if only as a stop gap.



    Hope This Helps.
    Sean.
    Digest of Homes

    WinXP, XL XP

  6. #6
    Board Regular
    Join Date
    Apr 2002
    Location
    Pittsburgh, PA
    Posts
    354
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hmmmm - sounds like a good way to do it. Thanks for the tip.

    My file is very VBA intensive already and I am trying to conserve file space. Does anyone know a way to do this without VBA?


    Thanks in advance,
    Patrick

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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