Results 1 to 3 of 3

Excel 2007: Code to allow auto filter in protected sheet

Threaded View

  1. #1
    Registered User
    Join Date
    10-10-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Excel 2007: Code to allow auto filter in protected sheet

    I have a code which protects the sheets on exit (see below). I need help creating a code that will protect the sheets, whilst allowing autofilter.

    Hours of searching forums have returned results, none of which seem to be effective. Microsoft help site was no good either, as their solution is for excel 2000 only.
    So far i have:
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    If Not Sheets("Jobs 1000+").ProtectContents Then
    Sheets("Jobs 1000+").Protect
    End If
    If Not Sheets("Jobs 913-999").ProtectContents Then
    Sheets("Jobs 913-999").Protect
    ActiveWorkbook.Save
    End If
    End Sub
    Any help would be greatly appreciated.
    Last edited by Sph01; 10-10-2011 at 09:10 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1